本文整理匯總了Java中cascading.util.Util類的典型用法代碼示例。如果您正苦於以下問題:Java Util類的具體用法?Java Util怎麽用?Java Util使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Util類屬於cascading.util包,在下文中一共展示了Util類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: sourceConfInit
import cascading.util.Util; //導入依賴的package包/類
@Override
public void sourceConfInit( FlowProcess<JobConf> process, Tap<JobConf, RecordReader, OutputCollector> tap,
JobConf conf ) {
int concurrentReads = ( (JDBCTap) tap ).concurrentReads;
if( selectQuery != null )
DBInputFormat.setInput( conf, TupleRecord.class, selectQuery, countQuery, limit, concurrentReads );
else {
String tableName = ( (JDBCTap) tap ).getTableName();
String joinedOrderBy = orderBy != null ? Util.join( orderBy, ", " ) : null;
DBInputFormat.setInput( conf, TupleRecord.class, tableName, conditions, joinedOrderBy, limit, concurrentReads, columns );
}
if( inputFormatClass != null )
conf.setInputFormat( inputFormatClass );
}
示例2: addSerializationToken
import cascading.util.Util; //導入依賴的package包/類
static void addSerializationToken(Object config) {
Configuration cfg = (Configuration) config;
String tokens = cfg.get(TupleSerializationProps.SERIALIZATION_TOKENS);
String lmw = LinkedMapWritable.class.getName();
// if no tokens are defined, add one starting with 140
if (tokens == null) {
cfg.set(TupleSerializationProps.SERIALIZATION_TOKENS, "140=" + lmw);
LogFactory.getLog(EsTap.class).trace(
String.format("Registered Cascading serialization token %s for %s", 140, lmw));
}
else {
// token already registered
if (tokens.contains(lmw)) {
return;
}
// find token id
Map<Integer, String> mapping = new LinkedHashMap<Integer, String>();
tokens = tokens.replaceAll("\\s", ""); // allow for whitespace in token set
for (String pair : tokens.split(",")) {
String[] elements = pair.split("=");
mapping.put(Integer.parseInt(elements[0]), elements[1]);
}
for (int id = 140; id < 255; id++) {
if (!mapping.containsKey(Integer.valueOf(id))) {
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;
}
}
}
}
示例3: getCreateTableStatement
import cascading.util.Util; //導入依賴的package包/類
/**
* 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, ", " ) );
}
示例4: sourceConfInit
import cascading.util.Util; //導入依賴的package包/類
@Override
public void sourceConfInit(FlowProcess<JobConf> process, Tap<JobConf, RecordReader, OutputCollector> tap,
JobConf conf) {
DeprecatedInputFormatWrapper.setInputFormat(org.apache.hadoop.hbase.mapreduce.TableInputFormat.class, conf,
ValueCopier.class);
if (null != familyNames) {
String columns = Util.join(this.familyNames, " ");
LOG.debug("sourcing from column families: {}", columns);
conf.set(org.apache.hadoop.hbase.mapreduce.TableInputFormat.SCAN_COLUMNS, columns);
}
}
示例5: addPrimaryKeyTo
import cascading.util.Util; //導入依賴的package包/類
protected List<String> addPrimaryKeyTo( List<String> createTableStatement ) {
if( hasPrimaryKey() )
createTableStatement.add( String.format( "PRIMARY KEY( %s )", Util.join( primaryKeys, ", " ) ) );
return createTableStatement;
}
示例6: getColumns
import cascading.util.Util; //導入依賴的package包/類
private String getColumns() {
return Util.join(columns(this.familyNames, this.valueFields), " ");
}