Package org.kiji.schema

Examples of org.kiji.schema.KijiDataRequest$Column


    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(3).addFamily("map"))
        .build();

    final KijiRowData row1 = mReader.get(mEntityId, dataRequest);
    final List<KijiCell<Integer>> cells = Lists.newArrayList(row1.<Integer>asIterable(MAP));
View Full Code Here


            ToolUtils.getMapTypeFamilies(argURI.getColumns(), tableLayout);

        final Map<FamilyLayout, List<ColumnLayout>> groupTypeColumns =
            ToolUtils.getGroupTypeColumns(argURI.getColumns(), tableLayout);

        final KijiDataRequest request = ToolUtils.getDataRequest(
            mapTypeFamilies, groupTypeColumns, mMaxVersions, mMinTimestamp, mMaxTimestamp);

        final KijiTableReader reader = table.openTableReader();
        try {
            // Return the specified entity.
View Full Code Here

  public void testBasicReadAndWrite() throws Exception {
    mBufferedWriter.put(mEntityId, "info", "name", 0L, "Value at timestamp 0.");
    mBufferedWriter.put(mEntityId, "info", "name", 1L, "Value at timestamp 1.");

    // These have not been flushed yet, so should not be present.
    final KijiDataRequest dataRequest = KijiDataRequest.builder()
        .addColumns(ColumnsDef.create().withMaxVersions(10).add("info", "name"))
        .build();

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

  }


  @Test
  public void testPutWithTimestamp() throws Exception {
    final KijiDataRequest request = KijiDataRequest.create("info", "name");

    // Write a value now.
    mWriter.put(mEntityId, "info", "name", 123L, "old");

    // Buffer the new value and confirm it has not been written.
View Full Code Here

    assertEquals("baz", actual2);
  }

  @Test
  public void testDeleteColumn() throws Exception {
    final KijiDataRequest request = KijiDataRequest.create("info");

    // Write initial value.
    mWriter.put(mEntityId, "info", "name", 123L, "not empty");
    mWriter.put(mEntityId, "info", "email", 123L, "not empty");
View Full Code Here

    assertTrue(mReader.get(mEntityId, request).containsCell("info", "email", 123L));
  }

  @Test
  public void testDeleteCell() throws Exception {
    final KijiDataRequest request = KijiDataRequest.create("info", "name");

    // Write initial value.
    mWriter.put(mEntityId, "info", "name", 123L, "not empty");

    // Buffer the delete and confirm it has not happened yet.
View Full Code Here

    assertFalse(mReader.get(mEntityId, request).containsCell("info", "name", 123L));
  }

  @Test
  public void testDeleteCellNoTimestamp() throws Exception {
    final KijiDataRequest request = KijiDataRequest.create("info", "name");

    // Write initial value.
    mWriter.put(mEntityId, "info", "name", 123L, "not empty");

    // Buffer the delete and confirm it has not happened yet.
View Full Code Here

    }
  }

  @Test
  public void testSetBufferSize() throws Exception {
    final KijiDataRequest request = KijiDataRequest.create("info", "name");

    // TODO: Remove duplicate puts from test when buffered writer calculates buffer size correctly.
    // (Right now the buffer size is measured in C* Statements, not bytes.)

    // Add a put to the buffer.
View Full Code Here

  @Test
  public void testBufferPutWithDelete() throws Exception {
    final EntityId oldEntityId = mTable.getEntityId("foo");
    final EntityId newEntityId = mTable.getEntityId("bar");
    final KijiDataRequest request = KijiDataRequest.create("info", "name");

    // Initialize data for the old entity ID.
    mWriter.put(oldEntityId, "info", "name", "foo-name");

    // Buffer a delete for "foo" and a put to "bar" and confirm they have not been written.
View Full Code Here

  ) {
    mResult = result;
    mCells = Iterators.peekingIterator(mResult.iterator());
    mLayout = layout;

    final KijiDataRequest dataRequest = mResult.getDataRequest();
    final Collection<Column> columnRequests = dataRequest.getColumns();
    Preconditions.checkArgument(columnRequests.size() == 1,
        "Can not create KijiResultPager with multiple columns. Data request: %s.", dataRequest);
    mColumnRequest = columnRequests.iterator().next();
  }
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.