Package org.kiji.schema

Examples of org.kiji.schema.Kiji


    }
  }

  @Test
  public void testDeletingKijiTableWithUsersDoesNotFail() throws Exception {
    final Kiji kiji = getKiji();
    final TableLayoutDesc layoutDesc = KijiTableLayouts.getLayout(KijiTableLayouts.FOO_TEST);
    final String tableName = layoutDesc.getName();
    kiji.createTable(layoutDesc);
    final KijiTable table = kiji.openTable(tableName);
    try {
      kiji.deleteTable(tableName);
    } finally {
      table.release();
    }
  }
View Full Code Here


  public void testUninstallingInstanceWithUsersDoesNotFail() throws Exception {
    final Configuration conf = HBaseConfiguration.create();
    final KijiURI uri = KijiURI.newBuilder(createTestHBaseURI()).withInstanceName("test").build();
    final KijiInstaller installer = KijiInstaller.get();
    installer.install(uri, conf);
    Kiji kiji = Kiji.Factory.get().open(uri);
    try {
      installer.uninstall(uri, conf);
    } finally {
      kiji.release();
    }
  }
View Full Code Here

   *
   * No paging involved in this test.
   */
  @Test
  public void testMaxVersionsEqualsOne() throws Exception {
    final Kiji kiji = new InstanceBuilder(getKiji())
        .withTable(KijiTableLayouts.getLayout(KijiTableLayouts.ROW_DATA_TEST))
            .withRow("row0")
                .withFamily("family")
                    .withQualifier("qual0")
                        .withValue(1L, "value-1")
                        .withValue(2L, "value-2")
                        .withValue(3L, "value-3")
                    .withQualifier("qual1")
                        .withValue(1L, "value-1")
                        .withValue(2L, "value-2")
                        .withValue(3L, "value-3")
                    .withQualifier("qual2")
                        .withValue(1L, "value-1")
                        .withValue(2L, "value-2")
                        .withValue(3L, "value-3")
        .build();

    final KijiTable table = kiji.openTable("row_data_test_table");
    try {
      final KijiTableReader reader = table.openTableReader();
      try {
        final KijiDataRequest dataRequest = KijiDataRequest.builder()
            .addColumns(ColumnsDef.create()
View Full Code Here

  /**
   * Tests that requesting an entire group-type family properly expands to all declared columns.
   */
  @Test
  public void testExpandGroupTypeFamily() throws Exception {
    final Kiji kiji = new InstanceBuilder(getKiji())
        .withTable(KijiTableLayouts.getLayout(KijiTableLayouts.ROW_DATA_TEST))
            .withRow("row0")
                .withFamily("family")
                    .withQualifier("qual0")
                        .withValue(1L, "value")
                    .withQualifier("qual1")
                        .withValue(1L, "value")
        .build();

    final KijiTable table = kiji.openTable("row_data_test_table");
    try {
      final KijiTableReader reader = table.openTableReader();
      try {
        final KijiDataRequest dataRequest = KijiDataRequest.builder()
            .addColumns(ColumnsDef.create()
View Full Code Here

   * Here we test that enabling paging on a column X:Y doesn't affect cells from other columns,
   * ie. we can still read the cells from non-paged columns.
   */
  @Test
  public void testScanPartiallyPaged() throws Exception {
    final Kiji kiji = new InstanceBuilder(getKiji())
        .withTable(KijiTableLayouts.getLayout(KijiTableLayouts.ROW_DATA_TEST))
            .withRow("row0")
                .withFamily("family")
                    .withQualifier("qual0")
                        .withValue(1L, "value1")
                        .withValue(2L, "value2")
                        .withValue(3L, "value3")
                .withFamily("map")
                    .withQualifier("int1")
                        .withValue(0L, 10)
                        .withValue(1L, 11)
                    .withQualifier("int2")
                        .withValue(0L, 20)
                        .withValue(1L, 21)
            .withRow("row1")
                .withFamily("family")
                    .withQualifier("qual0")
                        .withValue("value1")
            .withRow("row2")
                .withFamily("map")
                    .withQualifier("int2")
                        .withValue(2)
            .withRow("row3")
                .withFamily("family")
                    .withQualifier("qual1")
                        .withValue("value1")
        .build();

    final KijiTable table = kiji.openTable("row_data_test_table");
    try {
      final KijiTableReader reader = table.openTableReader();
      try {
        final KijiDataRequest dataRequest = KijiDataRequest.builder()
            .addColumns(ColumnsDef.create()
View Full Code Here

   * Here we test that paging on a column X:Y will not short-circuit the KeyValue scanner
   * and still return the requested KeyValues in columns > X:Y.
   */
  @Test
  public void testScanPartiallyPagedWithFirstKeyOnlyFilter() throws Exception {
    final Kiji kiji = new InstanceBuilder(getKiji())
        .withTable(KijiTableLayouts.getLayout(KijiTableLayouts.ROW_DATA_TEST))
            .withRow("row0")
                .withFamily("family")
                    .withQualifier("qual0")
                        .withValue(1L, "value1")
                        .withValue(2L, "value2")
                        .withValue(3L, "value3")
                .withFamily("map")
                    .withQualifier("int1")
                        .withValue(0L, 10)
                        .withValue(1L, 11)
                    .withQualifier("int2")
                        .withValue(0L, 20)
                        .withValue(1L, 21)
            .withRow("row1")
                .withFamily("family")
                    .withQualifier("qual0")
                        .withValue("value1")
            .withRow("row2")
                .withFamily("map")
                    .withQualifier("int2")
                        .withValue(2)
            .withRow("row3")
                .withFamily("family")
                    .withQualifier("qual1")
                        .withValue("value1")
        .build();

    final KijiTable table = kiji.openTable("row_data_test_table");
    try {
      final KijiTableReader reader = table.openTableReader();
      try {
        final KijiDataRequest dataRequest = KijiDataRequest.builder()
            .addColumns(ColumnsDef.create()
View Full Code Here

   * Scanning through rows with paging enabled returns rows where the only cells are visible
   * through paging (ie. the Result returned by the scanner would theoretically be empty).
   */
  @Test
  public void testScanCompletelyPaged() throws Exception {
    final Kiji kiji = new InstanceBuilder(getKiji())
        .withTable(KijiTableLayouts.getLayout(KijiTableLayouts.ROW_DATA_TEST))
            .withRow("row0")
                .withFamily("family")
                    .withQualifier("qual0")
                        .withValue("value0")
            .withRow("row1")
                .withFamily("family")
                    .withQualifier("qual1")
                        .withValue("value1")
            .withRow("row2")
                .withFamily("family")
                    .withQualifier("qual2")
                        .withValue("value2")
        .build();

    final KijiTable table = kiji.openTable("row_data_test_table");
    try {
      final KijiTableReader reader = table.openTableReader();
      try {
        final KijiDataRequest dataRequest = KijiDataRequest.builder()
            .addColumns(ColumnsDef.create()
View Full Code Here

   * Scanning through rows with paging enabled returns rows where the only cells are visible
   * through paging (ie. the Result returned by the scanner would theoretically be empty).
   */
  @Test
  public void testScanCompletelyPagedMapFamily() throws Exception {
    final Kiji kiji = new InstanceBuilder(getKiji())
        .withTable(KijiTableLayouts.getLayout(KijiTableLayouts.ROW_DATA_TEST))
            .withRow("row0")
                .withFamily("map")
                    .withQualifier("qual")
                        .withValue(314)
            .withRow("row1")
                .withFamily("map")
                    .withQualifier("qual")
                        .withValue(314)
            .withRow("row2")
                .withFamily("family")
                    .withQualifier("qual2")
                        .withValue("value2")
        .build();

    final KijiTable table = kiji.openTable("row_data_test_table");
    try {
      final KijiTableReader reader = table.openTableReader();
      try {
        final KijiDataRequest dataRequest = KijiDataRequest.builder()
            .addColumns(ColumnsDef.create()
View Full Code Here

  private volatile CuratorFramework mZKClient;
  private volatile InstanceMonitor mInstanceMonitor;

  @Before
  public void setUpTestInstanceMonitor() throws Exception {
    Kiji kiji = getKiji();
    TableLayoutDesc layout = KijiTableLayouts.getLayout(KijiTableLayouts.SIMPLE);
    kiji.createTable(layout);
    mTableURI = KijiURI.newBuilder(kiji.getURI()).withTableName(layout.getName()).build();
    mZKClient = ZooKeeperUtils.getZooKeeperClient(mTableURI);

    mInstanceMonitor = new InstanceMonitor(
        kiji.getSystemTable().getDataVersion(),
        kiji.getURI(),
        kiji.getSchemaTable(),
        kiji.getMetaTable(),
        mZKClient).start();
  }
View Full Code Here

  private static final Schema TEST_SCHEMA_B = Schema.createArray(SCHEMA_STRING);

  /** Tests the basic functionalities and properties of the schema table. */
  @Test
  public void testBasicSchemaTableFunctions() throws Exception {
    final Kiji kiji = getKiji();
    final KijiSchemaTable schemaTable = kiji.getSchemaTable();

    // Schema ID 0 must be primitive type STRING.
    assertEquals(Schema.Type.STRING, schemaTable.getSchema(0L).getType());

    // Test looking up a schema by ID:
View Full Code Here

TOP

Related Classes of org.kiji.schema.Kiji

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.