當前位置: 首頁>>代碼示例>>Java>>正文


Java Util類代碼示例

本文整理匯總了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 );
}
 
開發者ID:ParallelAI,項目名稱:SpyGlass,代碼行數:17,代碼來源:JDBCScheme.java

示例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;
            }
        }
    }
}
 
開發者ID:xushjie1987,項目名稱:es-hadoop-v2.2.0,代碼行數:37,代碼來源:CascadingUtils.java

示例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, ", " ) );
}
 
開發者ID:ParallelAI,項目名稱:SpyGlass,代碼行數:13,代碼來源:TableDesc.java

示例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);
	}
}
 
開發者ID:ParallelAI,項目名稱:SpyGlass,代碼行數:13,代碼來源:HBaseRawScheme.java

示例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;
}
 
開發者ID:ParallelAI,項目名稱:SpyGlass,代碼行數:7,代碼來源:TableDesc.java

示例6: getColumns

import cascading.util.Util; //導入依賴的package包/類
private String getColumns() {
  return Util.join(columns(this.familyNames, this.valueFields), " ");
}
 
開發者ID:ParallelAI,項目名稱:SpyGlass,代碼行數:4,代碼來源:HBaseScheme.java


注:本文中的cascading.util.Util類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。