当前位置: 首页>>代码示例>>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;未经允许,请勿转载。