Package org.kiji.schema

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


        KijiTableLayout.newLayout(
          KijiTableLayout.readTableLayoutDescFromJSON(
              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.
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 {
View Full Code Here

  /** Tests behavior of Avro enums. */
  @Test
  public void testEnumSchema() throws Exception {
    final Kiji kiji = getKiji();
    kiji.createTable(KijiTableLayouts.getLayout(LAYOUT_ENUM));

    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"));
View Full Code Here

      // Create & open a Kiji table.
      if (kiji.getTableNames().contains(tableName)) {
        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 {
View Full Code Here

  @Before
  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();
  }
View Full Code Here

public class TestStripValueRowFilter extends KijiClientTest {
  /** Verifies that values has been stripped if the StripValueRowFilter has been applied. */
  @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");

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 {
View Full Code Here

    cellSchema.setReaders(Lists.newArrayList(
        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 {
View Full Code Here

    cellSchema.setReaders(Lists.newArrayList(
        AvroSchema.newBuilder()
            .setUid(kiji.getSchemaTable().getOrCreateSchemaId(INT_TEXT_RECORD1))
            .build()));

    kiji.createTable(desc);
    final KijiTable table = kiji.openTable("dev");
    try {
      final EntityId eid = table.getEntityId("row");
      final KijiTableWriter writer = table.getWriterFactory().openTableWriter();
      try {
View Full Code Here

  }

  @Test
  public void testScanTable() throws Exception {
    final Kiji kiji = getKiji();
    kiji.createTable(KijiTableLayouts.getLayout(KijiTableLayouts.SIMPLE));
    final KijiTable table = kiji.openTable("table");
    try {
      // Table is empty:
      assertEquals(BaseTool.SUCCESS, runTool(new ScanTool(), table.getURI().toString()));
      assertEquals(1, mToolOutputLines.length);
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.