cascading.util.Util.join()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(200)

本文整理了Java中cascading.util.Util.join()方法的一些代码示例,展示了Util.join()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.join()方法的具体详情如下:
包路径:cascading.util.Util
类名称:Util
方法名:join

Util.join介绍

[英]This method joins each value in the collection with the given delimiter. All results are appended to the given StringBuffer instance.
[中]此方法将集合中的每个值与给定的分隔符联接。所有结果都附加到给定的StringBuffer实例。

代码示例

代码示例来源:origin: elastic/elasticsearch-hadoop

  1. cfg.set(TupleSerializationProps.SERIALIZATION_TOKENS, Util.join(",", Util.removeNulls(tokens, id + "=" + lmw)));
  2. LogFactory.getLog(EsTap.class).trace(String.format("Registered Cascading serialization token %s for %s", id, lmw));
  3. return;

代码示例来源:origin: cwensel/cascading

  1. /**
  2. * This method joins the values in the given list with the delim String value.
  3. *
  4. * @param list
  5. * @param delim
  6. * @return a String
  7. */
  8. public static String join( Object[] list, String delim )
  9. {
  10. return join( list, delim, false );
  11. }

代码示例来源:origin: cwensel/cascading

  1. /**
  2. * Method toString writes this Tuple instance values out to a String delimited by the given String value.
  3. *
  4. * @param delim of type String
  5. * @param printNull of type boolean
  6. * @return String
  7. */
  8. public String toString( String delim, boolean printNull )
  9. {
  10. return Util.join( elements, delim, printNull );
  11. }

代码示例来源:origin: cwensel/cascading

  1. /**
  2. * This method joins the values in the given list with the delim String value.
  3. *
  4. * @param list
  5. * @param delim
  6. * @return String
  7. */
  8. public static String join( int[] list, String delim )
  9. {
  10. return join( list, delim, false );
  11. }

代码示例来源:origin: cwensel/cascading

  1. /**
  2. * This method joins each valuein the collection with the given delimiter.
  3. *
  4. * @param collection
  5. * @param delim
  6. * @return a String
  7. */
  8. public static String join( Collection collection, String delim )
  9. {
  10. return join( collection, delim, false );
  11. }

代码示例来源:origin: cwensel/cascading

  1. /**
  2. * Method getFrameworks returns a list of frameworks used to build this App.
  3. *
  4. * @return Registered frameworks
  5. */
  6. public String getFrameworks()
  7. {
  8. return join( frameworks, "," );
  9. }

代码示例来源:origin: cwensel/cascading

  1. @Override
  2. public String toString()
  3. {
  4. return Util.join( elements, printDelim, true );
  5. }

代码示例来源:origin: cwensel/cascading

  1. public static String join( String delim, String... strings )
  2. {
  3. return join( delim, false, strings );
  4. }

代码示例来源:origin: cascading/lingual-core

  1. public static String buildPath( String fileSeparator, String rootPath, String... elements )
  2. {
  3. if( rootPath == null )
  4. rootPath = ".";
  5. if( !rootPath.endsWith( fileSeparator ) )
  6. rootPath += fileSeparator;
  7. return rootPath + Util.join( elements, fileSeparator );
  8. }

代码示例来源:origin: cwensel/cascading

  1. public static String unique( String value, String delim )
  2. {
  3. String[] split = value.split( delim );
  4. Set<String> values = new LinkedHashSet<String>();
  5. Collections.addAll( values, split );
  6. return join( values, delim );
  7. }

代码示例来源:origin: cwensel/cascading

  1. @Override
  2. protected void addPropertiesTo( Properties properties )
  3. {
  4. if( gatherPartitions > 0 )
  5. properties.setProperty( GATHER_PARTITIONS, Integer.toString( gatherPartitions ) );
  6. if( !logCounters.isEmpty() )
  7. properties.setProperty( LOG_COUNTERS, Util.join( logCounters, "," ) );
  8. if( combineSplits != null )
  9. properties.setProperty( COMBINE_SPLITS, Boolean.toString( combineSplits ) );
  10. }
  11. }

代码示例来源:origin: cwensel/cascading

  1. @Override
  2. public String toPartition( TupleEntry tupleEntry )
  3. {
  4. String partition = Util.join( tupleEntry.asIterableOf( String.class ), delimiter, true );
  5. if( postfix != null )
  6. partition = partition + postfix; // delimiter prefixed in ctor
  7. return partition;
  8. }
  9. }

代码示例来源:origin: cwensel/cascading

  1. /**
  2. * Adds the given className as a Hadoop IO serialization class.
  3. *
  4. * @param properties of type Map
  5. * @param className of type String
  6. */
  7. public static void addSerialization( Map<Object, Object> properties, String className )
  8. {
  9. String serializations = (String) properties.get( HADOOP_IO_SERIALIZATIONS );
  10. properties.put( HADOOP_IO_SERIALIZATIONS, Util.join( ",", Util.removeNulls( serializations, className ) ) );
  11. }

代码示例来源:origin: cascading/cascading-jdbc-core

  1. protected List<String> addPrimaryKeyTo( List<String> createTableStatement )
  2. {
  3. if( hasPrimaryKey() )
  4. createTableStatement.add( String.format( "PRIMARY KEY( %s )", Util.join( primaryKeys, ", " ) ) );
  5. return createTableStatement;
  6. }

代码示例来源:origin: cwensel/cascading

  1. private String makeName( Pipe[] pipes )
  2. {
  3. String[] names = new String[ pipes.length ];
  4. for( int i = 0; i < pipes.length; i++ )
  5. names[ i ] = pipes[ i ].getName();
  6. String name = Util.join( names, "+" );
  7. if( name.length() > 32 )
  8. name = name.substring( 0, 32 );
  9. return name;
  10. }
  11. }

代码示例来源:origin: cwensel/cascading

  1. @Override
  2. public String getName()
  3. {
  4. if( name == null )
  5. name = Util.join( getTailNames(), "+" );
  6. return name;
  7. }

代码示例来源:origin: cwensel/cascading

  1. private String makeName( Flow[] flows )
  2. {
  3. String[] names = new String[ flows.length ];
  4. for( int i = 0; i < flows.length; i++ )
  5. names[ i ] = flows[ i ].getName();
  6. return Util.join( names, "+" );
  7. }
  8. }

代码示例来源:origin: cascading/cascading-jdbc-core

  1. /**
  2. * Method getTableCreateStatement returns the tableCreateStatement of this
  3. * TableDesc object.
  4. *
  5. * @return the tableCreateStatement (type String) of this TableDesc object.
  6. */
  7. public String getCreateTableStatement()
  8. {
  9. List<String> createTableStatement = new ArrayList<String>();
  10. createTableStatement = addCreateTableBodyTo( createTableStatement );
  11. return String.format( getCreateTableFormat(), tableName, Util.join( createTableStatement, ", " ) );
  12. }

代码示例来源:origin: cwensel/cascading

  1. private void verifyPipelines()
  2. {
  3. if( pipelineGraphs == null || pipelineGraphs.isEmpty() )
  4. return;
  5. Set<FlowElement> allElements = createIdentitySet( nodeSubGraph.vertexSet() );
  6. for( ElementGraph pipelineGraph : pipelineGraphs )
  7. allElements.removeAll( pipelineGraph.vertexSet() );
  8. if( !allElements.isEmpty() )
  9. throw new IllegalStateException( "union of pipeline graphs for flow node are missing elements: " + Util.join( allElements, ", " ) );
  10. }

代码示例来源:origin: cwensel/cascading

  1. protected String getOutputPath()
  2. {
  3. if( outputPath == null )
  4. outputPath = Util.join( getOutputPathElements(), File.separator );
  5. return outputPath;
  6. }

相关文章