Package org.kiji.schema.layout

Examples of org.kiji.schema.layout.ColumnReaderSpec


    }

    int maxVersions = Math.max(col1.getMaxVersions(), col2.getMaxVersions());

    // Merge column read properties. We don't actually merge but enforce consistency:
    final ColumnReaderSpec readerSpec;
    if (col1.getReaderSpec() == null) {
      readerSpec = col2.getReaderSpec();
    } else if (col2.getReaderSpec() == null) {
      readerSpec = col1.getReaderSpec();
    } else if (Objects.equal(col1.getReaderSpec(), col2.getReaderSpec())) {
View Full Code Here


        .build();
  }

  @Test
  public void testSerialization() throws IOException, ClassNotFoundException {
    final ColumnReaderSpec spec = ColumnReaderSpec.avroDefaultReaderSchemaGeneric();
    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
    final ObjectOutputStream oos = new ObjectOutputStream(baos);
    oos.writeObject(spec);
    final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    final ObjectInputStream ois = new ObjectInputStream(bais);
    final ColumnReaderSpec spec2 = (ColumnReaderSpec) ois.readObject();
    assertEquals(spec, spec2);
  }
View Full Code Here

        .build();
  }

  @Test
  public void testSerialization() throws IOException, ClassNotFoundException {
    final ColumnReaderSpec spec = ColumnReaderSpec.avroDefaultReaderSchemaGeneric();
    final ByteArrayOutputStream baos = new ByteArrayOutputStream();
    final ObjectOutputStream oos = new ObjectOutputStream(baos);
    oos.writeObject(spec);
    final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
    final ObjectInputStream ois = new ObjectInputStream(bais);
    final ColumnReaderSpec spec2 = (ColumnReaderSpec) ois.readObject();
    assertEquals(spec, spec2);
  }
View Full Code Here

  public CellDecoderProvider getDecoderProviderForRequest(
      final KijiDataRequest request
  ) throws IOException {
    final List<BoundColumnReaderSpec> readerSpecs = Lists.newArrayList();
    for (Column columnRequest : request.getColumns()) {
      final ColumnReaderSpec readerSpec = columnRequest.getReaderSpec();
      if (readerSpec != null) {
        final KijiColumnName column = columnRequest.getColumnName();
        readerSpecs.add(BoundColumnReaderSpec.create(readerSpec, column));
      }
    }

    if (readerSpecs.isEmpty()) {
      return this;
    }

    final Map<KijiColumnName, KijiCellDecoder<?>> columnDecoders = Maps.newHashMap();
    columnDecoders.putAll(this.mColumnDecoders);

    for (BoundColumnReaderSpec readerSpec : readerSpecs) {
      columnDecoders.put(readerSpec.getColumn(), getDecoder(readerSpec));
    }

    return new CellDecoderProvider(
        mLayout,
        ImmutableMap.copyOf(columnDecoders),
View Full Code Here

TOP

Related Classes of org.kiji.schema.layout.ColumnReaderSpec

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.