Codota Logo
MeasureCodec.decode
Code IndexAdd Codota to your IDE (free)

How to use
decode
method
in
org.apache.kylin.metadata.measure.MeasureCodec

Best Java code snippets using org.apache.kylin.metadata.measure.MeasureCodec.decode (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
origin: KylinOLAP/Kylin

public void decode(Text bytes, Object[] result) {
  decode(ByteBuffer.wrap(bytes.getBytes(), 0, bytes.getLength()), result);
}
origin: KylinOLAP/Kylin

public void decode(byte[] bytes) {
  codec.decode(ByteBuffer.wrap(bytes), values);
  convertToJavaObjects(values, values);
}
origin: KylinOLAP/Kylin

@Override
public void map(Text key, Text value, Context context) throws IOException, InterruptedException {
  outputKey.set(key.getBytes(), 0, key.getLength());
  KeyValue outputValue;
  int n = keyValueCreators.size();
  if (n == 1 && keyValueCreators.get(0).isFullCopy) { // shortcut for
                            // simple full copy
    outputValue = keyValueCreators.get(0).create(key, value.getBytes(), 0, value.getLength());
    context.write(outputKey, outputValue);
  } else { // normal (complex) case that distributes measures to multiple
       // HBase columns
    inputCodec.decode(value, inputMeasures);
    for (int i = 0; i < n; i++) {
      outputValue = keyValueCreators.get(i).create(key, inputMeasures);
      context.write(outputKey, outputValue);
    }
  }
}
origin: KylinOLAP/Kylin

@Override
public void reduce(Text key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
  aggs.reset();
  for (Text value : values) {
    codec.decode(value, input);
    aggs.aggregate(input);
  }
  aggs.collectStates(result);
  valueBuf.clear();
  codec.encode(result, valueBuf);
  outputValue.set(valueBuf.array(), 0, valueBuf.position());
  context.write(key, outputValue);
  counter++;
  if (counter % BatchConstants.COUNTER_MAX == 0) {
    logger.info("Handled " + counter + " records!");
  }
}
origin: KylinOLAP/Kylin

private void verifyMeasures(List<MeasureDesc> measures, Text valueBytes, String m1, String m2, String m3) {
  MeasureCodec codec = new MeasureCodec(measures);
  Object[] values = new Object[measures.size()];
  codec.decode(valueBytes, values);
  assertTrue(new BigDecimal(m1).equals(values[0]));
  assertTrue(new BigDecimal(m2).equals(values[1]));
  assertTrue(new BigDecimal(m3).equals(values[2]));
}
origin: KylinOLAP/Kylin

public void aggregate(MeasureAggregator[] measureAggrs, List<Cell> rowCells) {
  int i = 0;
  for (int ci = 0; ci < nHCols; ci++) {
    HCol col = hcols[ci];
    Cell cell = findCell(col, rowCells);
    if (cell == null) {
      i += col.nMeasures;
      continue;
    }
    ByteBuffer input = ByteBuffer.wrap(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength());
    col.measureCodec.decode(input, col.measureValues);
    for (int j = 0; j < col.nMeasures; j++)
      measureAggrs[i++].aggregate(col.measureValues[j]);
  }
}
origin: KylinOLAP/Kylin

  fail();
hcol.measureCodec.decode(ByteBuffer.wrap(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength()), hcol.measureValues);
origin: KylinOLAP/Kylin

@Test
public void basicTest() {
  MeasureDesc descs[] = new MeasureDesc[] { measure("double"), measure("long"), measure("decimal"), measure("HLLC16"), measure("HLLC16") };
  MeasureCodec codec = new MeasureCodec(descs);
  DoubleWritable d = new DoubleWritable(1.0);
  LongWritable l = new LongWritable(2);
  BigDecimal b = new BigDecimal("333.1234567");
  HyperLogLogPlusCounter hllc = new HyperLogLogPlusCounter(16);
  hllc.add("1234567");
  hllc.add("abcdefg");
  HyperLogLogPlusCounter hllc2 = new HyperLogLogPlusCounter(16);
  hllc.add("1234567");
  hllc.add("abcdefg");
  Object values[] = new Object[] { d, l, b, hllc, hllc2 };
  ByteBuffer buf = ByteBuffer.allocate(RowConstants.ROWVALUE_BUFFER_SIZE);
  codec.encode(values, buf);
  buf.flip();
  System.out.println("size: " + buf.limit());
  Object copy[] = new Object[values.length];
  codec.decode(buf, copy);
  assertTrue(Arrays.equals(values, copy));
}
org.apache.kylin.metadata.measureMeasureCodecdecode

Popular methods of MeasureCodec

  • <init>
  • encode
  • getSerializer
  • init

Popular in Java

  • Running tasks concurrently on multiple threads
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • getExternalFilesDir (Context)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now