本文整理汇总了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), " ");
}