Package org.kiji.schema

Examples of org.kiji.schema.EntityId


    final Kiji kiji = getKiji();
    kiji.createTable(KijiTableLayouts.getLayout(KijiTableLayouts.SIMPLE));

    final KijiTable table = kiji.openTable("table");
    try {
      final EntityId eid = table.getEntityId("eid");

      {
        final KijiTableWriter writer = table.openTableWriter();
        try {
          writer.put(eid, "family", "column", 1L, "me");
View Full Code Here


  public void testNoReaderSchema() throws Exception {
    final Kiji kiji = getKiji();
    kiji.createTable(KijiTableLayouts.getLayout(LAYOUT_DEVELOPER));
    final KijiTable table = kiji.openTable("dev");
    try {
      final EntityId eid = table.getEntityId("row");
      final KijiTableWriter writer = table.getWriterFactory().openTableWriter();
      try {
        // Registers writer schema 'long':
        writer.put(eid, "info", "user_id", (Long) 1L);
View Full Code Here

            .build()));

    kiji.createTable(desc);
    final KijiTable table = kiji.openTable("dev");
    try {
      final EntityId eid = table.getEntityId("row");
      final KijiTableWriter writer = table.getWriterFactory().openTableWriter();
      try {
        // Registering 'long' as a writer schema: compatible with 'long' reader schema:
        writer.put(eid, "info", "user_id", (Long) 1L);
View Full Code Here

            .build()));

    kiji.createTable(desc);
    final KijiTable table = kiji.openTable("dev");
    try {
      final EntityId eid = table.getEntityId("row");
      final KijiTableWriter writer = table.getWriterFactory().openTableWriter();
      try {
        // Register writer schema TestRecord1, compatible with reader TestRecord2:
        final GenericData.Record record1 = new GenericData.Record(INT_RECORD1);
        record1.put("integer", 314);
View Full Code Here

              table.getURI().toString() + "info:name,info:email"
          ));
      assertEquals(30, mToolOutputLines.length);

        EntityIdFactory eif = EntityIdFactory.getFactory(layout);
        EntityId startEid = eif.getEntityId("christophe@usermail.example.com"); //second row
        EntityId limitEid = eif.getEntityId("john.doe@gmail.com"); //second to last row
        String startHbaseRowKey = Hex.encodeHexString(startEid.getHBaseRowKey());
        String limitHbaseRowKey = Hex.encodeHexString(limitEid.getHBaseRowKey());
      assertEquals(BaseTool.SUCCESS, runTool(new ScanTool(),
          table.getURI().toString() + "info:name",
          "--start-row=hbase=hex:" + startHbaseRowKey,  // start at the second row.
          "--limit-row=hbase=hex:" + limitHbaseRowKey   // end at the 2nd to last row (exclusive).
      ));
View Full Code Here

  @Test
  public void testRawParserLoop() throws Exception {
    final EntityIdFactory factory =
      EntityIdFactory.getFactory((RowKeyFormat) mRawLayout.getDesc().getKeysFormat());
    final EntityId eid = factory.getEntityIdFromHBaseRowKey(Bytes.toBytes("rawRowKey"));

    assertEquals(eid,
        ToolUtils.createEntityIdFromUserInputs(eid.toShellString(), mRawLayout));
  }
View Full Code Here

  @Test
  public void testHashedParserLoop() throws Exception {
    final EntityIdFactory factory =
       EntityIdFactory.getFactory((RowKeyFormat) mHashedLayout.getDesc().getKeysFormat());
    final EntityId eid = factory.getEntityId("hashedRowKey");

    assertEquals(eid,
        ToolUtils.createEntityIdFromUserInputs(eid.toShellString(), mHashedLayout));
  }
View Full Code Here

  @Test
  public void testHashPrefixedParserLoop() throws Exception {
    final EntityIdFactory factory =
       EntityIdFactory.getFactory((RowKeyFormat) mHashPrefixedLayout.getDesc().getKeysFormat());
    final EntityId eid = factory.getEntityId("hashPrefixedRowKey");

    assertEquals(
        eid, ToolUtils.createEntityIdFromUserInputs(eid.toShellString(), mHashPrefixedLayout));
  }
View Full Code Here

  @Test
  public void testHBaseEIDtoRawEID() throws Exception {
    final EntityIdFactory factory =
      EntityIdFactory.getFactory((RowKeyFormat) mRawLayout.getDesc().getKeysFormat());
    final EntityId reid = factory.getEntityId("rawEID");
    final EntityId hbeid = HBaseEntityId.fromHBaseRowKey(reid.getHBaseRowKey());

    assertEquals(reid,
        ToolUtils.createEntityIdFromUserInputs(hbeid.toShellString(), mRawLayout));
  }
View Full Code Here

  @Test
  public void testHBaseEIDtoHashedEID() throws Exception {
    final EntityIdFactory factory =
      EntityIdFactory.getFactory((RowKeyFormat) mHashedLayout.getDesc().getKeysFormat());
    final EntityId heid = factory.getEntityId("hashedEID");
    final EntityId hbeid = HBaseEntityId.fromHBaseRowKey(heid.getHBaseRowKey());

    assertEquals(heid,
        ToolUtils.createEntityIdFromUserInputs(hbeid.toShellString(), mHashedLayout));

  }
View Full Code Here

TOP

Related Classes of org.kiji.schema.EntityId

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.