Package org.apache.hadoop.hbase.client

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


      table.put(put);
      put = new Put(Bytes.toBytes("row1"));
      put.add(fam, qual, 123l, value1);
      put.setCellVisibility(new CellVisibility(SECRET));
      table.put(put);
      table.flushCommits();
      //TEST_UTIL.getHBaseAdmin().flush(tableName);
      Scan s = new Scan();
      s.setMaxVersions(5);
      s.setAuthorizations(new Authorizations(CONFIDENTIAL, SECRET));
      ResultScanner scanner = table.getScanner(s);
View Full Code Here


            table = new HTable(conf, tableName);
            d = new Delete(row1);
            d.setCellVisibility(new CellVisibility(SECRET));
            d.deleteColumn(fam, qual, 123l);
            table.delete(d);
            table.flushCommits();
          } catch (Throwable t) {
            throw new IOException(t);
          }
          return null;
        }
View Full Code Here

            d = new Delete(row1);
            d.setCellVisibility(new CellVisibility(SECRET));
            d.deleteFamily(fam);
            table.delete(d);
            table.flushCommits();

            d = new Delete(row1);
            d.setCellVisibility(new CellVisibility("(" + PRIVATE + "&" + CONFIDENTIAL + ")|("
                + SECRET + "&" + TOPSECRET + ")"));
            d.deleteFamily(fam);
View Full Code Here

            d = new Delete(row1);
            d.setCellVisibility(new CellVisibility("(" + PRIVATE + "&" + CONFIDENTIAL + ")|("
                + SECRET + "&" + TOPSECRET + ")"));
            d.deleteFamily(fam);
            table.delete(d);
            table.flushCommits();
          } catch (Throwable t) {
            throw new IOException(t);
          }
          return null;
        }
View Full Code Here

            d = new Delete(row1);
            d.setCellVisibility(new CellVisibility(SECRET + "&" + TOPSECRET));
            d.deleteColumns(fam, qual);
            table.delete(d);
            table.flushCommits();
          } catch (Throwable t) {
            throw new IOException(t);
          }
          return null;
        }
View Full Code Here

    Table table = new HTable(UTIL.getConfiguration(), TableName.valueOf("primary"));
    Put p = new Put(new byte[] { 'a' });
    p.add(family, null, new byte[] { 'a' });
    table.put(p);
    table.flushCommits();
    table.close();

    Table target = new HTable(UTIL.getConfiguration(), otherTable);
    assertTrue("Didn't complete update to target table!", completeCheck[0]);
    assertEquals("Didn't find inserted row", 1, getKeyValueCount(target));
View Full Code Here

    @Override
    public void prePut(final ObserverContext<RegionCoprocessorEnvironment> e, final Put put,
        final WALEdit edit, final Durability durability) throws IOException {
      Table table = e.getEnvironment().getTable(otherTable);
      table.put(put);
      table.flushCommits();
      completed[0] = true;
      table.close();
    }

  }
View Full Code Here

          LOG.debug("PUT " + put.toString());
        }
      }
      table = servlet.getTable(tableResource.getName());
      table.put(puts);
      table.flushCommits();
      ResponseBuilder response = Response.ok();
      servlet.getMetrics().incrementSucessfulPutRequests(1);
      return response.build();
    } catch (Exception e) {
      servlet.getMetrics().incrementFailedPutRequests(1);
View Full Code Here

        servlet.getMetrics().incrementFailedPutRequests(1);
        return Response.status(Response.Status.NOT_MODIFIED)
          .type(MIMETYPE_TEXT).entity("Value not Modified" + CRLF)
          .build();
      }
      table.flushCommits();
      ResponseBuilder response = Response.ok();
      servlet.getMetrics().incrementSucessfulPutRequests(1);
      return response.build();
    } catch (Exception e) {
      servlet.getMetrics().incrementFailedPutRequests(1);
View Full Code Here

        servlet.getMetrics().incrementFailedDeleteRequests(1);
        return Response.status(Response.Status.NOT_MODIFIED)
            .type(MIMETYPE_TEXT).entity(" Delete check failed." + CRLF)
            .build();
      }
      table.flushCommits();
      ResponseBuilder response = Response.ok();
      servlet.getMetrics().incrementSucessfulDeleteRequests(1);
      return response.build();
    } catch (Exception e) {
      servlet.getMetrics().incrementFailedDeleteRequests(1);
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.