当前位置: 首页>>代码示例>>Java>>正文


Java TridentOperationContext类代码示例

本文整理汇总了Java中storm.trident.operation.TridentOperationContext的典型用法代码示例。如果您正苦于以下问题:Java TridentOperationContext类的具体用法?Java TridentOperationContext怎么用?Java TridentOperationContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TridentOperationContext类属于storm.trident.operation包,在下文中一共展示了TridentOperationContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: prepare

import storm.trident.operation.TridentOperationContext; //导入依赖的package包/类
@Override
public void prepare(Map conf, TridentOperationContext context) {
    logger = RbLogger.getLogger(ProcessMse10Association.class.getName());

    cache = new HashMap<>();
    cache.put(0, "IDLE");
    cache.put(1, "AAA_PENDING");
    cache.put(2, "AUTHENTICATED");
    cache.put(3, "ASSOCIATED");
    cache.put(4, "POWERSAVE");
    cache.put(5, "DISASSOCIATED");
    cache.put(6, "TO_BE_DELETED");
    cache.put(7, "PROBING");
    cache.put(8, "BLACK_LISTED");
    cache.put(256, "WAIT_AUTHENTICATED");
    cache.put(257, "WAIT_ASSOCIATED");
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:18,代码来源:ProcessMse10Association.java

示例2: prepare

import storm.trident.operation.TridentOperationContext; //导入依赖的package包/类
/**
 * Initializing the database reference and patterns.
 */
@Override
public void prepare(Map conf, TridentOperationContext context) {
    try {
        _city = new LookupService(CITY_DB_PATH, LookupService.GEOIP_MEMORY_CACHE);
        _city6 = new LookupService(CITY_V6_DB_PATH, LookupService.GEOIP_MEMORY_CACHE);
        _asn = new LookupService(ASN_DB_PATH, LookupService.GEOIP_MEMORY_CACHE);
        _asn6 = new LookupService(ASN_V6_DB_PATH, LookupService.GEOIP_MEMORY_CACHE);
        VALID_IPV4_PATTERN = Pattern.compile(ipv4Pattern, Pattern.CASE_INSENSITIVE);
        VALID_IPV6_PATTERN = Pattern.compile(ipv6Pattern, Pattern.CASE_INSENSITIVE);
    } catch (IOException ex) {
        Logger.getLogger(GeoIpFunction.class.getName()).log(Level.SEVERE, ex.toString());
    } catch (PatternSyntaxException e) {
        Logger.getLogger(GeoIpFunction.class.getName()).log(Level.SEVERE, "Unable to compile IP check patterns");
    }
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:19,代码来源:GeoIpFunction.java

示例3: prepare

import storm.trident.operation.TridentOperationContext; //导入依赖的package包/类
@Override
public void prepare(Map conf, TridentOperationContext context){
    if (conf.get(backtype.storm.Config.TOPOLOGY_DEBUG).equals(true)) {
        testMode = true;
        CSVReader reader;
        try {
            reader = new CSVReader(new BufferedReader(
                    new InputStreamReader(
                            DocumentFetchFunction.class
                                    .getResourceAsStream("docs.csv"))));
            List<String[]> myEntries = reader.readAll();
            for(String[] row : myEntries){
                testData.put(row[0], row[1]);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
 
开发者ID:domenicosolazzo,项目名称:tfidf-topology,代码行数:21,代码来源:DocumentFetchFunction.java

示例4: prepare

import storm.trident.operation.TridentOperationContext; //导入依赖的package包/类
@Override
public void prepare(Map conf, TridentOperationContext context) {
    try {
        String path = (String) conf.get("DOCUMENT_PATH");
        schema = Schema.parse(PersistDocumentFunction.class
                .getResourceAsStream("/document.avsc"));
        File file = new File(path);
        DatumWriter<GenericRecord> datumWriter = new GenericDatumWriter<GenericRecord>(schema);
        dataFileWriter = new DataFileWriter<GenericRecord>(datumWriter);
        if(file.exists())
            dataFileWriter.appendTo(file);
        else
            dataFileWriter.create(schema, file);
    } catch (IOException e) {
        throw new RuntimeException(e);
    }

}
 
开发者ID:domenicosolazzo,项目名称:tfidf-topology,代码行数:19,代码来源:PersistDocumentFunction.java

示例5: prepare

import storm.trident.operation.TridentOperationContext; //导入依赖的package包/类
@Override
public void prepare(Map conf, TridentOperationContext context) {
    _count = new HashMap<>();
    _sec_count = 0;
    _mean = 0;
    _totalMean = 0;
    System.out.println("Starting throughput metrics [ " + _position + " ]");
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:9,代码来源:ThroughputLoggingFilter.java

示例6: prepare

import storm.trident.operation.TridentOperationContext; //导入依赖的package包/类
@Override
public void prepare(Map conf, TridentOperationContext context) {
    // logger = RbLogger.getLogger(PostgreSQLocation.class.getName());
    PostgresqlManager.initConfig(uri, user, pass, updateTime, failUpdateTime);
    _manager = PostgresqlManager.getInstance();
    _manager.init();
}
 
开发者ID:redBorder,项目名称:rb-bi,代码行数:8,代码来源:PostgreSQLocation.java

示例7: prepare

import storm.trident.operation.TridentOperationContext; //导入依赖的package包/类
@Override
public void prepare(Map conf, TridentOperationContext context) {
       _inputFactories = new ProjectionFactory[_inputFields.length];
       for(int i=0; i<_inputFields.length; i++) {
           _inputFactories[i] = context.makeProjectionFactory(_inputFields[i]);
           _aggs[i].prepare(conf, new TridentOperationContext(context, _inputFactories[i]));
       }
   }
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:9,代码来源:ChainedAggregatorImpl.java

示例8: prepare

import storm.trident.operation.TridentOperationContext; //导入依赖的package包/类
@Override
public void prepare(Map conf, TopologyContext context, TridentContext tridentContext) {
    List<Factory> parents = tridentContext.getParentTupleFactories();
    if(parents.size()!=1) {
        throw new RuntimeException("Aggregate operation can only have one parent");
    }
    _context = tridentContext;
    _collector = new FreshCollector(tridentContext);
    _projection = new ProjectionFactory(parents.get(0), _inputFields);
    _agg.prepare(conf, new TridentOperationContext(context, _projection));
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:12,代码来源:AggregateProcessor.java

示例9: prepare

import storm.trident.operation.TridentOperationContext; //导入依赖的package包/类
@Override
public void prepare(Map conf, TopologyContext context, TridentContext tridentContext) {
    List<Factory> parents = tridentContext.getParentTupleFactories();
    if(parents.size()!=1) {
        throw new RuntimeException("State query operation can only have one parent");
    }
    _context = tridentContext;
    _state = (State) context.getTaskData(_stateId);
    _projection = new ProjectionFactory(parents.get(0), _inputFields);
    _collector = new AppendCollector(tridentContext);
    _function.prepare(conf, new TridentOperationContext(context, _projection));
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:13,代码来源:StateQueryProcessor.java

示例10: prepare

import storm.trident.operation.TridentOperationContext; //导入依赖的package包/类
@Override
public void prepare(Map conf, TopologyContext context, TridentContext tridentContext) {
    List<Factory> parents = tridentContext.getParentTupleFactories();
    if(parents.size()!=1) {
        throw new RuntimeException("Partition persist operation can only have one parent");
    }
    _context = tridentContext;
    _state = (State) context.getTaskData(_stateId);
    _projection = new ProjectionFactory(parents.get(0), _inputFields);
    _collector = new FreshCollector(tridentContext);
    _updater.prepare(conf, new TridentOperationContext(context, _projection));
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:13,代码来源:PartitionPersistProcessor.java

示例11: prepare

import storm.trident.operation.TridentOperationContext; //导入依赖的package包/类
@Override
public void prepare(Map conf, TopologyContext context, TridentContext tridentContext) {
    List<Factory> parents = tridentContext.getParentTupleFactories();
    if(parents.size()!=1) {
        throw new RuntimeException("Each operation can only have one parent");
    }
    _context = tridentContext;
    _collector = new AppendCollector(tridentContext);
    _projection = new ProjectionFactory(parents.get(0), _inputFields);
    _function.prepare(conf, new TridentOperationContext(context, _projection));
}
 
开发者ID:zhangjunfang,项目名称:jstorm-0.9.6.3-,代码行数:12,代码来源:EachProcessor.java

示例12: prepare

import storm.trident.operation.TridentOperationContext; //导入依赖的package包/类
@Override
public void prepare(Map conf, TridentOperationContext context) {
    Properties props = new Properties();
    props.put("metadata.broker.list", conf.get(CrawlerConfig.KAFKA_PRODUCER_HOST_NAME)+":"+conf.get( CrawlerConfig.KAFKA_PRODUCER_HOST_PORT) );
    props.put("serializer.class", "kafka.serializer.StringEncoder");
    this.producer = new kafka.javaapi.producer.Producer<String, String>(new ProducerConfig(props));
    this.kafkaTopic = (String) conf.get( CrawlerConfig.KAFKA_TOPIC_NAME );
}
 
开发者ID:skalmadka,项目名称:web-crawler,代码行数:9,代码来源:KafkaProducerFilter.java

示例13: prepare

import storm.trident.operation.TridentOperationContext; //导入依赖的package包/类
@Override
public void prepare(Map conf, TridentOperationContext context) {
    bloomFilter = new RedisBloomFilter<String>(Integer.parseInt(conf.get(CrawlerConfig.BLOOM_FILTER_EXPECTED_ELEMENT_COUNT).toString()),
                                                Double.parseDouble(conf.get(CrawlerConfig.BLOOM_FILTER_DESIRED_FALSE_POSITIVE).toString()),
                                                conf.get(CrawlerConfig.REDIS_HOST_NAME).toString(),
                                                Short.parseShort(conf.get(CrawlerConfig.REDIS_HOST_PORT).toString()),
                                                conf.get(CrawlerConfig.BLOOM_FILTER_NAME).toString()
                                                );
}
 
开发者ID:skalmadka,项目名称:web-crawler,代码行数:10,代码来源:URLFilter.java

示例14: prepare

import storm.trident.operation.TridentOperationContext; //导入依赖的package包/类
public void prepare(Map conf, TridentOperationContext context) {
    _inputFactories = new ProjectionFactory[_inputFields.length];
    for(int i=0; i<_inputFields.length; i++) {
        _inputFactories[i] = context.makeProjectionFactory(_inputFields[i]);
        _aggs[i].prepare(conf, new TridentOperationContext(context, _inputFactories[i]));
    }
}
 
开发者ID:songtk,项目名称:learn_jstorm,代码行数:8,代码来源:ChainedAggregatorImpl.java

示例15: prepare

import storm.trident.operation.TridentOperationContext; //导入依赖的package包/类
public void prepare(Map conf, TridentOperationContext context) {
    _inputFactories = new ProjectionFactory[_inputFields.length];
    for (int i = 0; i < _inputFields.length; i++) {
        _inputFactories[i] = context.makeProjectionFactory(_inputFields[i]);
        _aggs[i].prepare(conf, new TridentOperationContext(context, _inputFactories[i]));
    }
}
 
开发者ID:kkllwww007,项目名称:jstrom,代码行数:8,代码来源:ChainedAggregatorImpl.java


注:本文中的storm.trident.operation.TridentOperationContext类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。