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

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

本文整理了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

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

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

/**
 * This method joins the values in the given list with the delim String value.
 *
 * @param list
 * @param delim
 * @return a String
 */
public static String join( Object[] list, String delim )
 {
 return join( list, delim, false );
 }

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

/**
 * Method toString writes this Tuple instance values out to a String delimited by the given String value.
 *
 * @param delim     of type String
 * @param printNull of type boolean
 * @return String
 */
public String toString( String delim, boolean printNull )
 {
 return Util.join( elements, delim, printNull );
 }

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

/**
 * This method joins the values in the given list with the delim String value.
 *
 * @param list
 * @param delim
 * @return String
 */
public static String join( int[] list, String delim )
 {
 return join( list, delim, false );
 }

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

/**
 * This method joins each valuein the collection with the given delimiter.
 *
 * @param collection
 * @param delim
 * @return a String
 */
public static String join( Collection collection, String delim )
 {
 return join( collection, delim, false );
 }

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

/**
 * Method getFrameworks returns a list of frameworks used to build this App.
 *
 * @return Registered frameworks
 */
public String getFrameworks()
 {
 return join( frameworks, "," );
 }

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

@Override
public String toString()
 {
 return Util.join( elements, printDelim, true );
 }

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

public static String join( String delim, String... strings )
 {
 return join( delim, false, strings );
 }

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

public static String buildPath( String fileSeparator, String rootPath, String... elements )
 {
 if( rootPath == null )
  rootPath = ".";
 if( !rootPath.endsWith( fileSeparator ) )
  rootPath += fileSeparator;
 return rootPath + Util.join( elements, fileSeparator );
 }

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

public static String unique( String value, String delim )
 {
 String[] split = value.split( delim );
 Set<String> values = new LinkedHashSet<String>();
 Collections.addAll( values, split );
 return join( values, delim );
 }

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

@Override
protected void addPropertiesTo( Properties properties )
 {
 if( gatherPartitions > 0 )
  properties.setProperty( GATHER_PARTITIONS, Integer.toString( gatherPartitions ) );
 if( !logCounters.isEmpty() )
  properties.setProperty( LOG_COUNTERS, Util.join( logCounters, "," ) );
 if( combineSplits != null )
  properties.setProperty( COMBINE_SPLITS, Boolean.toString( combineSplits ) );
 }
}

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

@Override
public String toPartition( TupleEntry tupleEntry )
 {
 String partition = Util.join( tupleEntry.asIterableOf( String.class ), delimiter, true );
 if( postfix != null )
  partition = partition + postfix; // delimiter prefixed in ctor
 return partition;
 }
}

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

/**
 * Adds the given className as a Hadoop IO serialization class.
 *
 * @param properties of type Map
 * @param className  of type String
 */
public static void addSerialization( Map<Object, Object> properties, String className )
 {
 String serializations = (String) properties.get( HADOOP_IO_SERIALIZATIONS );
 properties.put( HADOOP_IO_SERIALIZATIONS, Util.join( ",", Util.removeNulls( serializations, className ) ) );
 }

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

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

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

private String makeName( Pipe[] pipes )
 {
 String[] names = new String[ pipes.length ];
 for( int i = 0; i < pipes.length; i++ )
  names[ i ] = pipes[ i ].getName();
 String name = Util.join( names, "+" );
 if( name.length() > 32 )
  name = name.substring( 0, 32 );
 return name;
 }
}

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

@Override
public String getName()
 {
 if( name == null )
  name = Util.join( getTailNames(), "+" );
 return name;
 }

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

private String makeName( Flow[] flows )
 {
 String[] names = new String[ flows.length ];
 for( int i = 0; i < flows.length; i++ )
  names[ i ] = flows[ i ].getName();
 return Util.join( names, "+" );
 }
}

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

/**
 * Method getTableCreateStatement returns the tableCreateStatement of this
 * TableDesc object.
 *
 * @return the tableCreateStatement (type String) of this TableDesc object.
 */
public String getCreateTableStatement()
 {
 List<String> createTableStatement = new ArrayList<String>();
 createTableStatement = addCreateTableBodyTo( createTableStatement );
 return String.format( getCreateTableFormat(), tableName, Util.join( createTableStatement, ", " ) );
 }

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

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

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

protected String getOutputPath()
 {
 if( outputPath == null )
  outputPath = Util.join( getOutputPathElements(), File.separator );
 return outputPath;
 }

相关文章