Package org.apache.hadoop.hbase.client

Examples of org.apache.hadoop.hbase.client.HTable.flushCommits()


    p = new Put(row1);
    p.add(FAM, indexed_qualifer, ts6, value6);
    p.add(FAM2, indexed_qualifer, ts6, v6_1);
    primary.put(p);
    primary.flushCommits();

    /*
     * now we have definitely exceeded the number of versions visible to a usual client of the
     * primary table, so we should try doing a put 'back in time' an make sure that has the correct
     * index values and cleanup
View Full Code Here


     * index values and cleanup
     */
    p = new Put(row1);
    p.add(FAM, indexed_qualifer, ts2, value2);
    primary.put(p);
    primary.flushCommits();

    // read the index for the expected values
    HTable index1 = new HTable(UTIL.getConfiguration(), fam1.getTable());

    // do a raw scan of everything in the table
View Full Code Here

    // do a simple put that should be indexed
    Put p = new Put(Bytes.toBytes("row"));
    p.add(family, null, Bytes.toBytes("value"));
    primary.put(p);
    try {
      primary.flushCommits();
      fail("Shouldn't have gotten a successful write to the primary table");
    } catch (RetriesExhaustedWithDetailsException e) {
      LOG.info("Correclty got a failure of the put!");
    }
    primary.close();
View Full Code Here

    codec.verifiers.add(new ListMatchingVerifier("put state 1", allKvs, familyRef));

    // do the actual put (no indexing will actually be done)
    HTable primary = state.table;
    primary.put(p);
    primary.flushCommits();

    // now we do another put to the same row. We should see just the old row state, followed by the
    // new + old
    p = new Put(row, ts + 1);
    p.add(family, qual, Bytes.toBytes("v2"));
View Full Code Here

    codec.verifiers.add(new ListMatchingVerifier("cleanup state 2", expectedKvs, familyRef));
    codec.verifiers.add(new ListMatchingVerifier("put state 2", allKvs, familyRef));
   
    // do the actual put
    primary.put(p);
    primary.flushCommits();

    // cleanup after ourselves
    cleanup(state);
  }
View Full Code Here

    // do the actual put (no indexing will actually be done)
    HTable primary = state.table;
    primary.setAutoFlush(false);
    primary.put(Arrays.asList(p1, p2));
    primary.flushCommits();

    // cleanup after ourselves
    cleanup(state);
  }
View Full Code Here

    // add to meta.
    Put put = new Put(hri.getRegionName());
    put.add(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER,
        Writables.getBytes(hri));
    meta.put(put);
    meta.flushCommits();
    return hri;
  }

  protected void wipeOutMeta() throws IOException {
    // Mess it up by blowing up meta.
View Full Code Here

      Delete d = new Delete(r.getRow());
      dels.add(d);
      admin.unassign(r.getRow(), true);
    }
    meta.delete(dels);
    meta.flushCommits();
  }

  /**
   * Returns the number of rows in a given table. HBase must be up and the table
   * should be present (will wait for timeout for a while otherwise)
View Full Code Here

        table.put(put);
        if (LOG.isDebugEnabled()) {
          LOG.debug("PUT " + put.toString());
        }
      }
      table.flushCommits();
      ResponseBuilder response = Response.ok();
      return response.build();
    } catch (IOException e) {
      throw new WebApplicationException(e,
                  Response.Status.SERVICE_UNAVAILABLE);
View Full Code Here

      table = pool.getTable(this.table);
      table.put(put);
      if (LOG.isDebugEnabled()) {
        LOG.debug("PUT " + put.toString());
      }
      table.flushCommits();
      return Response.ok().build();
    } catch (IOException e) {
      throw new WebApplicationException(e,
                  Response.Status.SERVICE_UNAVAILABLE);
    } finally {
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.