Package io.druid.segment.serde

Examples of io.druid.segment.serde.ComplexMetricSerde


        case FLOAT:
          metWriters.add(new FloatMetricColumnSerializer(metric, v8OutDir, ioPeon));
          break;
        case COMPLEX:
          final String typeName = metricTypeNames.get(metric);
          ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(typeName);

          if (serde == null) {
            throw new ISE("Unknown type[%s]", typeName);
          }
View Full Code Here


              } else {
                if (typeName.equals("float")) {
                  return rawColumnSelector;
                }

                final ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(typeName);
                if (serde == null) {
                  throw new ISE("Don't know how to handle type[%s]", typeName);
                }

                final ComplexMetricExtractor extractor = serde.getExtractor();
                return new ObjectColumnSelector()
                {
                  @Override
                  public Class classOfObject()
                  {
View Full Code Here

                final Integer metricIndexInt = index.getMetricIndex(columnName);

                if (metricIndexInt != null) {
                  final int metricIndex = metricIndexInt;

                  final ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(index.getMetricType(columnName));
                  final BufferAggregator agg = index.getAggregator(metricIndex);
                  return new ObjectColumnSelector()
                  {
                    @Override
                    public Class classOfObject()
                    {
                      return serde.getObjectStrategy().getClazz();
                    }

                    @Override
                    public Object get()
                    {
View Full Code Here

        break;
      }
      case COMPLEX:
        String complexType = metricTypeNames.get(metric);

        ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(complexType);

        if (serde == null) {
          throw new ISE("Unknown type[%s]", complexType);
        }

        final GenericIndexed metricColumn = GenericIndexed.fromIterable(
            Iterables.transform(
                theRows,
                new Function<Rowboat, Object>()
                {
                  @Override
                  public Object apply(Rowboat input)
                  {
                    return input.getMetrics()[metricIndex];
                  }
                }
            ),
            serde.getObjectStrategy()
        );

        metBuilder.setValueType(ValueType.COMPLEX);
        writeColumn(
            v9Smoosher,
View Full Code Here

  {
    final ColumnCapabilities capabilities = column.getCapabilities();
    final ComplexColumn complexColumn = column.getComplexColumn();

    final String typeName = complexColumn.getTypeName();
    final ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(typeName);
    if (serde == null) {
      return ColumnAnalysis.error(String.format("unknown_complex_%s", typeName));
    }

    final Function<Object, Long> inputSizeFn = serde.inputSizeFn();
    if (inputSizeFn == null) {
      return ColumnAnalysis.error("noSizeFn");
    }

    final int length = column.getLength();
View Full Code Here

        break;
      case COMPLEX:
        if (strategy != null) {
          holder.complexType = GenericIndexed.read(buf, strategy);
        } else {
          final ComplexMetricSerde serdeForType = ComplexMetrics.getSerdeForType(holder.getTypeName());

          if (serdeForType == null) {
            throw new ISE("Unknown type[%s], cannot load.", holder.getTypeName());
          }

          holder.complexType = GenericIndexed.read(buf, serdeForType.getObjectStrategy());
        }
        break;
    }

    return holder;
View Full Code Here

TOP

Related Classes of io.druid.segment.serde.ComplexMetricSerde

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.