Package org.kiji.schema

Examples of org.kiji.schema.KijiDataRequest$Column


  }

  /** {@inheritDoc} */
  @Override
  public KijiDataRequest getDataRequest() {
    KijiDataRequest dataRequest = KijiDataRequest.builder().build();
    for (KijiRowFilter filter : mFilters) {
      if (filter != null) {
        dataRequest = dataRequest.merge(filter.getDataRequest());
      }
    }
    return dataRequest;
  }
View Full Code Here


  // -----------------------------------------------------------------------------------------------
  // Test cases that need to interact with an actual Kiji table.

  @Test
  public void testEntityId() throws Exception {
    final KijiDataRequest dataRequest = KijiDataRequest.builder()
        .addColumns(ColumnsDef.create().add(FAMILY, QUAL0))
        .build();

    // Put some data into the table.
    mWriter.put(mEntityId, FAMILY, QUAL0, Bytes.toBytes("bot"));
View Full Code Here

    // Put some data into the table.
    mWriter.put(mEntityId, FAMILY, QUAL3, 1L, 42);

    KijiDataRequestBuilder builder = KijiDataRequest.builder();
    builder.newColumnsDef().add(FAMILY, QUAL3);
    KijiDataRequest dataRequest = builder.build();

    // Read out the results to get a KijiRowData
    final KijiRowData input = mReader.get(mEntityId, dataRequest);

    assertNotNull(input.getMostRecentValue(FAMILY, QUAL3));
View Full Code Here

  }

  @Test
  public void testGetReaderSchema() throws Exception {
    // Empty data request.
    final KijiDataRequest dataRequest = KijiDataRequest.builder().build();

    // Read data for an entity ID that does not exist.
    final KijiRowData input = mReader.get(mEntityId, dataRequest);

    assertEquals(Schema.create(Schema.Type.STRING), input.getReaderSchema("family", "empty"));
View Full Code Here

    assertEquals(Schema.create(Schema.Type.INT), input.getReaderSchema("family", "qual3"));
  }

  @Test
  public void testGetReaderSchemaNoSuchColumn() throws Exception {
    final KijiDataRequest dataRequest = KijiDataRequest.builder().build();

    // Read data for an entity ID that does not exist.
    final KijiRowData input = mReader.get(mEntityId, dataRequest);

    try {
View Full Code Here

    mWriter.put(mEntityId, "family", "qual2", 3L, "q2-three");
    mWriter.put(mEntityId, "family", "qual2", 4L, "q2-four");
    mWriter.put(mEntityId, "family", "qual2", 6L, "q2-six");

    final KijiDataRequest dataRequest = KijiDataRequest.builder()
        .withTimeRange(2L, 7L)
        .addColumns(ColumnsDef.create().add("family", "qual0"))
        .addColumns(ColumnsDef.create().withMaxVersions(2).add("family", "qual1"))
        .addColumns(ColumnsDef.create().withMaxVersions(3).add("family", "qual2"))
        .build();
View Full Code Here

    // TODO: Test having results for a family, but not for a particular qualifier.
    // TODO: Test not having results for family or qualifier.
    mWriter.put(mEntityId, "family", "qual0", 1L, "string1");
    mWriter.put(mEntityId, "family", "qual0", 2L, "string2");

    final KijiDataRequest dataRequest = KijiDataRequest.builder()
        .addColumns(ColumnsDef.create().add("family", "qual1"))
        .build();

    final KijiRowData row1 = mReader.get(mEntityId, dataRequest);
View Full Code Here

  public void testGetMap() throws Exception {
    // Put some data into the table.
    mWriter.put(mEntityId, FAMILY, QUAL0, "bot");
    mWriter.put(mEntityId, FAMILY, EMPTY, "car");

    final KijiDataRequest dataRequest = KijiDataRequest.builder().build();

    // We didn't request any data, so the map should be null.
    final KijiRowData input = mReader.get(mEntityId, dataRequest);
  }
View Full Code Here

    mWriter.put(mEntityId, MAP, KEY1, 1L, 1);
    mWriter.put(mEntityId, MAP, KEY2, 1L, 2);
    mWriter.put(mEntityId, FAMILY, QUAL0, 1L, "string1");
    mWriter.put(mEntityId, FAMILY, QUAL0, 2L, "string2");

    final KijiDataRequest dataRequest = KijiDataRequest.builder()
        .addColumns(ColumnsDef.create().withMaxVersions(1).addFamily(MAP))
        .build();

    final KijiRowData row1 = mReader.get(mEntityId, dataRequest);
    final Iterator<KijiCell<Integer>> cells = row1.iterator(MAP);
View Full Code Here

  public void testIteratorMapFamilyMaxVersionsTypes() throws IOException {
    mWriter.put(mEntityId, MAP, KEY0, 1L, 0);
    mWriter.put(mEntityId, MAP, KEY0, 2L, 1);
    mWriter.put(mEntityId, MAP, KEY0, 3L, 2);

    final KijiDataRequest dataRequest = KijiDataRequest.builder()
        .addColumns(ColumnsDef.create().withMaxVersions(2).addFamily("map"))
        .build();

    final KijiRowData row1 = mReader.get(mEntityId, dataRequest);
    final Iterator<KijiCell<Integer>> cells = row1.iterator(MAP);
View Full Code Here

TOP

Related Classes of org.kiji.schema.KijiDataRequest$Column

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.