Examples of CellSpec


Examples of org.kiji.schema.layout.CellSpec

    }

    // Pro-actively build cell encoders for all columns in the table:
    final Map<String, KijiCellEncoder> encoderMap = Maps.newHashMap();
    for (KijiColumnName column : columns) {
      final CellSpec cellSpec = layout.getCellSpec(column)
          .setColumnURI(
              KijiURI.newBuilder(tableURI).withColumnNames(ImmutableList.of(column)).build())
          .setSchemaTable(schemaTable)
          .setEncoderFactory(factory);

      final KijiCellEncoder encoder = cellSpec.getEncoderFactory().create(cellSpec);
      encoderMap.put(column.getName(), encoder);
    }
    mEncoderMap = ImmutableMap.copyOf(encoderMap);
  }
View Full Code Here

Examples of org.kiji.schema.layout.CellSpec

    mKijiURI = kijiURI;
    mTable = Preconditions.checkNotNull(htable);
    mFamily = Preconditions.checkNotNull(family);
    mFamilyBytes = Bytes.toBytes(mFamily);
    mSchemaTable = Preconditions.checkNotNull(schemaTable);
    final CellSpec cellSpec = CellSpec.fromCellSchema(CELL_SCHEMA, mSchemaTable);
    mCellEncoder = new AvroCellEncoder(cellSpec);
    mCellDecoder = SpecificCellDecoderFactory.get().create(cellSpec);
  }
View Full Code Here

Examples of org.kiji.schema.layout.CellSpec

    final ImmutableMap.Builder<KijiColumnName, KijiCellDecoder<?>> decoderMap =
        ImmutableMap.builder();
    for (KijiColumnName column : columns) {
      // Gets the specification for this column,
      // from the overlay map or else from the actual table layout:
      CellSpec cellSpec = overrides.get(column);
      if (null == cellSpec) {
        cellSpec = layout.getCellSpec(column);
      } else {
        // Deep-copy the user-provided CellSpec:
        cellSpec = CellSpec.copy(cellSpec);
      }

      // Fills in the missing details to build the decoder:
      if (cellSpec.getSchemaTable() == null) {
        cellSpec.setSchemaTable(schemaTable);
      }
      if (cellSpec.getDecoderFactory() == null) {
        cellSpec.setDecoderFactory(factory);
      }

      final KijiCellDecoder<?> decoder = cellSpec.getDecoderFactory().create(cellSpec);
      decoderMap.put(column, decoder);
    }
    return new CellDecoderProvider(
        layout,
        decoderMap.build(),
View Full Code Here

Examples of org.kiji.schema.layout.CellSpec

      // from the overlay map or else from the actual table layout:
      final BoundColumnReaderSpec spec = overrides.get(column);
      if (null != spec) {
        decoderMap.put(column, createDecoderFromSpec(layout, spec));
      } else {
        final CellSpec cellSpec = layout.getCellSpec(column);
        decoderMap.put(column, cellSpec.getDecoderFactory().create(cellSpec));
      }
    }
    return decoderMap.build();
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.