Examples of openTableWriter()


Examples of org.kiji.schema.KijiTable.openTableWriter()

      final String dog = "dog";
      final String rabbit = "rabbit";
      final String fish = "fish";
      final String bird = "bird";

      final KijiTableWriter writer = table.openTableWriter();
      try {
        // Insert some data into the table.  Give various users different pets.
        writer.put(alice, pets, cat, 0L, "Alister");
        writer.put(bob, pets, cat, 0L, "Buffy");
        writer.put(cathy, pets, cat, 0L, "Mr Cat");
View Full Code Here

Examples of org.kiji.schema.KijiTable.openTableWriter()

      final String dog = "dog";
      final String rabbit = "rabbit";
      final String fish = "fish";
      final String bird = "bird";

      final KijiTableWriter writer = table.openTableWriter();
      try {
        // Insert some data into the table.  Give various users different pets.
        writer.put(alice, pets, cat, 0L, "Alister");
        writer.put(bob, pets, cat, 0L, "Buffy");
        writer.put(cathy, pets, cat, 0L, "Mr Cat");
View Full Code Here

Examples of org.kiji.schema.KijiTable.openTableWriter()

      // demonstrating with.
      EntityId entityId = table.getEntityId(userId);

      // ----- Write a row to the table. -----
      // Get a TableWriter for our table.
      KijiTableWriter tableWriter = table.openTableWriter();
      // Surround with a try/finally so the tablewriter gets closed.
      try {
        System.out.println("Putting user " + username + " into table.");
        tableWriter.put(entityId, "info", "name", username);
        // Flush the write to the table, since this is a demo and
View Full Code Here

Examples of org.kiji.schema.KijiTable.openTableWriter()

        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
              : table.entrySet()) {
            final EntityId entityId = rowEntry.getKey();
View Full Code Here

Examples of org.kiji.schema.KijiTable.openTableWriter()

    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");
          writer.put(eid, "family", "column", 2L, "me-too");
        } finally {
          writer.close();
View Full Code Here

Examples of org.kiji.schema.KijiTable.openTableWriter()

    try {
      assertNotNull(mTable);
      // Fill local variables.
      KijiTableReader mReader = mTable.openTableReader();
      try {
        KijiTableWriter mWriter = mTable.openTableWriter();
        try {
          EntityId mEntityId = mTable.getEntityId("eid-foo");

          mWriter.put(mEntityId, "family", "column", 0L, "Value at timestamp 0.");
          mWriter.put(mEntityId, "family", "column", 1L, "Value at timestamp 1.");
View Full Code Here

Examples of org.kiji.schema.KijiTable.openTableWriter()

      // Write a (generic) record:
      final Schema writerSchema = Schema.createRecord("Found", null, "class.not", false);
      writerSchema.setFields(Lists.newArrayList(
          new Field("field", Schema.create(Schema.Type.STRING), null, null)));

      final KijiTableWriter writer = table.openTableWriter();
      try {
        final GenericData.Record record = new GenericRecordBuilder(writerSchema)
            .set("field", "value")
            .build();
        writer.put(table.getEntityId("eid"), "family", "qualifier", 1L, record);
View Full Code Here

Examples of org.kiji.schema.KijiTable.openTableWriter()

  protected int run(List<String> nonFlagArgs) throws Exception {
    final Kiji kiji = Kiji.Factory.open(mCellURI, getConf());
    try {
      final KijiTable table = kiji.openTable(mCellURI.getTable());
      try {
        final KijiTableWriter writer = table.openTableWriter();
        try {
          for (KijiColumnName column : mCellURI.getColumns()) {
            try {
              final CellSchema cellSchema = table.getLayout().getCellSchema(column);
              if (cellSchema.getType() != SchemaType.COUNTER) {
View Full Code Here

Examples of org.kiji.schema.KijiTable.openTableWriter()

    try {
      final HBaseKijiTable htable = HBaseKijiTable.downcast(table);
      final TableLayoutMonitor monitor = htable.getTableLayoutMonitor();
      assertTrue(monitor.getLayoutConsumers().isEmpty());
      // Writers should register with the table as they open.
      final KijiTableWriter writer = table.openTableWriter();
      final KijiBufferedWriter bufferedWriter = table.getWriterFactory().openBufferedWriter();
      final AtomicKijiPutter atomicPutter = table.getWriterFactory().openAtomicPutter();

      // Check that all writers are accounted for.
      final Set<LayoutConsumer> consumers = monitor.getLayoutConsumers();
View Full Code Here

Examples of org.kiji.schema.KijiTable.openTableWriter()

    final KijiTable table = mKiji.openTable("user");
    try {
      final HBaseKijiTable htable = HBaseKijiTable.downcast(table);
      final TableLayoutMonitor monitor = htable.getTableLayoutMonitor();
      assertTrue(monitor.getLayoutConsumers().isEmpty());
      final KijiTableWriter writer = table.openTableWriter();
      try {
        assertTrue(monitor.getLayoutConsumers().size() == 1);

        // We can write to info:name, but not family:column.
        writer.put(table.getEntityId("foo"), "info", "name", "new-val");
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.