Package org.kiji.schema

Examples of org.kiji.schema.Kiji.openTable()


              new FileInputStream(tableDesc)));

      // Create the kiji table.
      kiji.createTable(tableName, layout);
      // Get a handle to the table.
      KijiTable table = kiji.openTable(tableName);

      // Get the entity ID, according to this table, of the user we are
      // demonstrating with.
      EntityId entityId = table.getEntityId(userId);
View Full Code Here


  /** Tests expansion of a writer schema union { null, string }. */
  @Test
  public void testUnionWriterSchema() throws Exception {
    final Kiji kiji = getKiji();
    kiji.createTable(KijiTableLayouts.getLayout(LAYOUT_UNION_WRITER));
    final KijiTable table = kiji.openTable(TABLE_NAME);
    try {
      final EntityId eid = table.getEntityId("row");
      final KijiTableWriter writer = table.getWriterFactory().openTableWriter();
      try {
        // Writing naked type "null" should work:
View Full Code Here

    final Schema readerEnum =
        Schema.createEnum("Gender", null, null, ImmutableList.of("MALE", "FEMALE"));
    final Schema writerEnum =
        Schema.createEnum("Gender", null, null, ImmutableList.of("MALE", "FEMALE", "BOTH"));

    final KijiTable table = kiji.openTable(TABLE_NAME);
    try {

      final TableLayoutDesc updateWithReader =
          new TableLayoutBuilder(table.getLayout().getDesc(), kiji)
              .withReader(KijiColumnName.create("info""gender"), readerEnum)
View Full Code Here

        LOG.info(String.format("  Populating existing table: %s", tableName));
      } else {
        LOG.info(String.format("  Creating and populating table: %s", tableName));
        kiji.createTable(layout.getDesc());
      }
      final KijiTable kijiTable = kiji.openTable(tableName);
      try {
        final KijiTableWriter writer = kijiTable.openTableWriter();
        try {
          // Build & write rows to the table.
          for (Map.Entry<EntityId, Map<String, Map<String, Map<Long, Object>>>> rowEntry
View Full Code Here

                .withFamily("family")
                    .withQualifier("column")
                        .withValue("0123456789")
        .build();

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

      final KijiTableLayout layout = table.getLayout();
      final KijiColumnName column = KijiColumnName.create("family", "column");
View Full Code Here

  public final void setupTestKijiPaginationFilter() throws Exception {
    final Kiji kiji = getKiji();
    mTableLayout = KijiTableLayouts.getLayout(KijiTableLayouts.PAGING_TEST);
    kiji.createTable(mTableLayout);

    mTable = kiji.openTable("user");
    mReader = mTable.openTableReader();
  }

  @After
  public final void teardownTestKijiPaginationFilter() throws Exception {
View Full Code Here

                        .withValue(2L, "name2")
                    .withQualifier("email")
                        .withValue(1L, "email1")
                        .withValue(2L, "email2")
        .build();
    final KijiTable table = kiji.openTable("user");
    try {
      final KijiTableReader reader = table.openTableReader();
      try {
        final EntityId eid = table.getEntityId("row");
View Full Code Here

  @Test
  public void testStripValueRowFilter() throws Exception {
    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();
View Full Code Here

  /** Tests writer schema registration with no reader schema, ie. no constraint. */
  @Test
  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':
View Full Code Here

        AvroSchema.newBuilder()
            .setUid(kiji.getSchemaTable().getOrCreateSchemaId(SCHEMA_LONG))
            .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:
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.