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;
/** * 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 ); }
/** * 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 ); }
/** * 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 ); }
/** * 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 ); }
/** * Method getFrameworks returns a list of frameworks used to build this App. * * @return Registered frameworks */ public String getFrameworks() { return join( frameworks, "," ); }
@Override public String toString() { return Util.join( elements, printDelim, true ); }
public static String join( String delim, String... strings ) { return join( delim, false, strings ); }
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 ); }
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 ); }
@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 ) ); } }
@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; } }
/** * 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 ) ) ); }
protected List<String> addPrimaryKeyTo( List<String> createTableStatement ) { if( hasPrimaryKey() ) createTableStatement.add( String.format( "PRIMARY KEY( %s )", Util.join( primaryKeys, ", " ) ) ); return createTableStatement; }
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; } }
@Override public String getName() { if( name == null ) name = Util.join( getTailNames(), "+" ); return name; }
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, "+" ); } }
/** * 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, ", " ) ); }
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, ", " ) ); }
protected String getOutputPath() { if( outputPath == null ) outputPath = Util.join( getOutputPathElements(), File.separator ); return outputPath; }