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


Java BinaryTimeSeries类代码示例

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


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

示例1: convert

import de.qaware.chronix.converter.BinaryTimeSeries; //导入依赖的package包/类
/**
 * Converts a time series of type <T> to lucene document.
 * Handles the default java object types (e.g. double, int, array, collections, ...)
 * and wraps them into the matching lucene fields (int -> IntField).
 *
 * @param ts the time series of type <T>
 * @return a filled lucene document
 */
private static <T> Document convert(T ts, TimeSeriesConverter<T> converter) {
    BinaryTimeSeries series = converter.to(ts);
    Document document = new Document();

    series.getFields().entrySet().forEach(entry -> {

        if (entry.getValue() instanceof Number) {
            handleNumbers(document, entry.getKey(), entry.getValue());
        } else if (entry.getValue() instanceof String || entry.getValue() instanceof byte[]) {
            handleStringsAndBytes(document, entry.getKey(), entry.getValue());
        } else if (entry.getValue() instanceof Collection || entry.getValue() instanceof Object[]) {
            handleArraysAndIterable(document, entry.getKey(), entry.getValue());
        } else {
            LOGGER.debug("Field {} could not be handled. Type is not supported", entry);
        }
    });
    return document;
}
 
开发者ID:ChronixDB,项目名称:chronix.storage,代码行数:27,代码来源:LuceneAddingService.java

示例2: call

import de.qaware.chronix.converter.BinaryTimeSeries; //导入依赖的package包/类
/**
 * Converts the solr document given in the constructor into a time series of type <T>
 *
 * @return a time series of type <T>
 * @throws Exception if bad things happen.
 */
@Override
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public T call() throws Exception {
    BinaryTimeSeries.Builder timeSeriesBuilder = new BinaryTimeSeries.Builder();
    document.forEach(attributeField -> timeSeriesBuilder.field(attributeField.getKey(), attributeField.getValue()));
    LOGGER.debug("Calling document converter with {}", document);
    T timeSeries = documentConverter.from(timeSeriesBuilder.build(), queryStart, queryEnd);
    LOGGER.debug("Returning time series {} to callee", timeSeries);
    return timeSeries;
}
 
开发者ID:ChronixDB,项目名称:chronix.spark,代码行数:17,代码来源:TimeSeriesConverterCaller.java

示例3: convertFromTuple

import de.qaware.chronix.converter.BinaryTimeSeries; //导入依赖的package包/类
/**
 * Converts a tuple into a MetricTimeSeries
 *
 * @param tuple the tuple
 * @return a MetricTimeSeries containing the tuple data
 */
private MetricTimeSeries convertFromTuple(Tuple tuple) {
    BinaryTimeSeries.Builder timeSeriesBuilder = new BinaryTimeSeries.Builder();
    tuple.fields.forEach((k, v) ->
            timeSeriesBuilder.field(k.toString(), v));
    MetricTimeSeries timeSeries = converter.from(timeSeriesBuilder.build(), 0l, 0l); //MetricTimeSeriesConverter does not use queryStart / queryEnd
    return timeSeries;
}
 
开发者ID:ChronixDB,项目名称:chronix.spark,代码行数:14,代码来源:SolrTupleStreamingService.java

示例4: call

import de.qaware.chronix.converter.BinaryTimeSeries; //导入依赖的package包/类
/**
 * Converts the solr document given in the constructor into a time series of type <T>
 *
 * @return a time series of type <T>
 * @throws Exception if bad things happen.
 */
@Override
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public T call() throws Exception {
    BinaryTimeSeries.Builder timeSeriesBuilder = new BinaryTimeSeries.Builder();

    document.forEach(attributeField -> timeSeriesBuilder.field(attributeField.getKey(), attributeField.getValue()));
    LOGGER.debug("Calling document converter with {}", document);
    T timeSeries = documentConverter.from(timeSeriesBuilder.build(), queryStart, queryEnd);
    LOGGER.debug("Returning time series {} to callee", timeSeries);
    return timeSeries;
}
 
开发者ID:ChronixDB,项目名称:chronix.server,代码行数:18,代码来源:TimeSeriesConverterCaller.java

示例5: convert

import de.qaware.chronix.converter.BinaryTimeSeries; //导入依赖的package包/类
/**
 * Converts a time series of type <T> to SolInputDocument
 *
 * @param ts - the time series
 * @return a filled SolrInputDocument
 */
private static <T> SolrInputDocument convert(T ts, TimeSeriesConverter<T> converter) {
    BinaryTimeSeries series = converter.to(ts);
    SolrInputDocument solrDocument = new SolrInputDocument();
    series.getFields().entrySet().forEach(entry -> solrDocument.addField(entry.getKey(), entry.getValue()));
    return solrDocument;
}
 
开发者ID:ChronixDB,项目名称:chronix.server,代码行数:13,代码来源:SolrAddingService.java

示例6: call

import de.qaware.chronix.converter.BinaryTimeSeries; //导入依赖的package包/类
/**
 * Converts the solr document given in the constructor into a time series of type <T>
 *
 * @return a time series of type <T>
 * @throws Exception if bad things happen.
 */
@Override
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public T call() throws Exception {
    BinaryTimeSeries.Builder timeSeriesBuilder = new BinaryTimeSeries.Builder();

    Map<String, List<Object>> multivalued = new HashMap<>();

    document.forEach(attributeField -> {
        String key = attributeField.name();

        if (key.contains(ChronixLuceneStorageConstants.MULTI_VALUE_FIELD_DELIMITER)) {
            key = key.substring(0, key.indexOf(ChronixLuceneStorageConstants.MULTI_VALUE_FIELD_DELIMITER));
            //Handle multivalued fields
            if (!multivalued.containsKey(key)) {
                multivalued.put(key, new ArrayList<>());
            }
            multivalued.get(key).add(convert(attributeField));

        } else {
            timeSeriesBuilder.field(key, convert(attributeField));
        }
    });
    multivalued.forEach(timeSeriesBuilder::field);

    LOGGER.debug("Calling document converter with {}", document);
    T timeSeries = documentConverter.from(timeSeriesBuilder.build(), queryStart, queryEnd);
    LOGGER.debug("Returning time series {} to callee", timeSeries);
    return timeSeries;
}
 
开发者ID:ChronixDB,项目名称:chronix.storage,代码行数:36,代码来源:TimeSeriesConverterCaller.java

示例7: from

import de.qaware.chronix.converter.BinaryTimeSeries; //导入依赖的package包/类
@Override
public SimpleTimeSeries from(BinaryTimeSeries binaryTimeSeries, long queryStart, long queryEnd) {
    SimpleTimeSeries doc = new SimpleTimeSeries();
    binaryTimeSeries.getFields().forEach(doc::add);

    return doc;
}
 
开发者ID:ChronixDB,项目名称:chronix.storage,代码行数:8,代码来源:SimpleTimeSeriesConverter.java

示例8: fromProtocolBuffers

import de.qaware.chronix.converter.BinaryTimeSeries; //导入依赖的package包/类
private void fromProtocolBuffers(BinaryTimeSeries binaryTimeSeries, long queryStart, long queryEnd, MetricTimeSeries.Builder builder) {
    ProtoBufMetricTimeSeriesSerializer.from(binaryTimeSeries.getPoints(), binaryTimeSeries.getStart(), binaryTimeSeries.getEnd(), queryStart, queryEnd, builder);
}
 
开发者ID:ChronixDB,项目名称:chronix.spark,代码行数:4,代码来源:MetricTimeSeriesConverter.java

示例9: fromJson

import de.qaware.chronix.converter.BinaryTimeSeries; //导入依赖的package包/类
private void fromJson(BinaryTimeSeries binaryTimeSeries, long queryStart, long queryEnd, MetricTimeSeries.Builder builder) {
    throw new UnsupportedOperationException();
}
 
开发者ID:ChronixDB,项目名称:chronix.spark,代码行数:4,代码来源:MetricTimeSeriesConverter.java

示例10: meanDate

import de.qaware.chronix.converter.BinaryTimeSeries; //导入依赖的package包/类
private long meanDate(BinaryTimeSeries binaryTimeSeries) {
    long start = binaryTimeSeries.getStart();
    long end = binaryTimeSeries.getEnd();

    return start + ((end - start) / 2);
}
 
开发者ID:ChronixDB,项目名称:chronix.spark,代码行数:7,代码来源:MetricTimeSeriesConverter.java

示例11: to

import de.qaware.chronix.converter.BinaryTimeSeries; //导入依赖的package包/类
@Override
public BinaryTimeSeries to(MetricTimeSeries timeSeries) {
    throw new UnsupportedOperationException();
}
 
开发者ID:ChronixDB,项目名称:chronix.spark,代码行数:5,代码来源:MetricTimeSeriesConverter.java

示例12: from

import de.qaware.chronix.converter.BinaryTimeSeries; //导入依赖的package包/类
@Override
public BinaryTimeSeries from(BinaryTimeSeries binaryStorageDocument, long queryStart, long queryEnd) {
    return binaryStorageDocument;
}
 
开发者ID:ChronixDB,项目名称:chronix.spark,代码行数:5,代码来源:DefaultTimeSeriesConverter.java

示例13: to

import de.qaware.chronix.converter.BinaryTimeSeries; //导入依赖的package包/类
@Override
public BinaryTimeSeries to(BinaryTimeSeries timeSeries) {
    return timeSeries;
}
 
开发者ID:ChronixDB,项目名称:chronix.spark,代码行数:5,代码来源:DefaultTimeSeriesConverter.java

示例14: from

import de.qaware.chronix.converter.BinaryTimeSeries; //导入依赖的package包/类
@Override
public BinaryTimeSeries from(BinaryTimeSeries binaryTimeSeries, long queryStart, long queryEnd) {
    //Just return the binary time series
    return binaryTimeSeries;
}
 
开发者ID:ChronixDB,项目名称:chronix.server,代码行数:6,代码来源:DefaultTimeSeriesConverter.java

示例15: to

import de.qaware.chronix.converter.BinaryTimeSeries; //导入依赖的package包/类
@Override
public BinaryTimeSeries to(BinaryTimeSeries timeSeries) {
    //Just return the binary time series
    return timeSeries;
}
 
开发者ID:ChronixDB,项目名称:chronix.server,代码行数:6,代码来源:DefaultTimeSeriesConverter.java


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