Tabnine Logo
ThriftServerRunner$HBaseHandler.checkAndPut
Code IndexAdd Tabnine to your IDE (free)

How to use
checkAndPut
method
in
org.apache.hadoop.hbase.thrift.ThriftServerRunner$HBaseHandler

Best Java code snippets using org.apache.hadoop.hbase.thrift.ThriftServerRunner$HBaseHandler.checkAndPut (Showing top 2 results out of 315)

origin: com.aliyun.hbase/alihbase-thrift

/**
 * Check that checkAndPut fails if the cell does not exist, then put in the cell, then check that
 * the checkAndPut succeeds.
 *
 * @throws Exception
 */
public static void doTestCheckAndPut() throws Exception {
 ThriftServerRunner.HBaseHandler handler =
  new ThriftServerRunner.HBaseHandler(UTIL.getConfiguration(),
   UserProvider.instantiate(UTIL.getConfiguration()));
 handler.createTable(tableAname, getColumnDescriptors());
 try {
  List<Mutation> mutations = new ArrayList<>(1);
  mutations.add(new Mutation(false, columnAname, valueAname, true));
  Mutation putB = (new Mutation(false, columnBname, valueBname, true));
  assertFalse(handler.checkAndPut(tableAname, rowAname, columnAname, valueAname, putB, null));
  handler.mutateRow(tableAname, rowAname, mutations, null);
  assertTrue(handler.checkAndPut(tableAname, rowAname, columnAname, valueAname, putB, null));
  TRowResult rowResult = handler.getRow(tableAname, rowAname, null).get(0);
  assertEquals(rowAname, rowResult.row);
  assertEquals(valueBname, rowResult.columns.get(columnBname).value);
 } finally {
  handler.disableTable(tableAname);
  handler.deleteTable(tableAname);
 }
}
origin: org.apache.hbase/hbase-thrift

/**
 * Check that checkAndPut fails if the cell does not exist, then put in the cell, then check that
 * the checkAndPut succeeds.
 *
 * @throws Exception
 */
public static void doTestCheckAndPut() throws Exception {
 ThriftServerRunner.HBaseHandler handler =
  new ThriftServerRunner.HBaseHandler(UTIL.getConfiguration(),
   UserProvider.instantiate(UTIL.getConfiguration()));
 handler.createTable(tableAname, getColumnDescriptors());
 try {
  List<Mutation> mutations = new ArrayList<>(1);
  mutations.add(new Mutation(false, columnAname, valueAname, true));
  Mutation putB = (new Mutation(false, columnBname, valueBname, true));
  assertFalse(handler.checkAndPut(tableAname, rowAname, columnAname, valueAname, putB, null));
  handler.mutateRow(tableAname, rowAname, mutations, null);
  assertTrue(handler.checkAndPut(tableAname, rowAname, columnAname, valueAname, putB, null));
  TRowResult rowResult = handler.getRow(tableAname, rowAname, null).get(0);
  assertEquals(rowAname, rowResult.row);
  assertEquals(valueBname, rowResult.columns.get(columnBname).value);
 } finally {
  handler.disableTable(tableAname);
  handler.deleteTable(tableAname);
 }
}
org.apache.hadoop.hbase.thriftThriftServerRunner$HBaseHandlercheckAndPut

Popular methods of ThriftServerRunner$HBaseHandler

  • <init>
  • deleteAllRowTs
  • deleteAllTs
  • get
    Note: this internal interface is slightly different from public APIs in regard to handling of the qu
  • getRowWithColumnsTs
  • getVerTs
    Note: this internal interface is slightly different from public APIs in regard to handling of the qu
  • increment
  • mutateRowTs
  • mutateRowsTs
  • addScanner
    Assigns a unique ID to the scanner and adds the mapping to an internal hash-map.
  • atomicIncrement
  • getRowsWithColumnsTs
  • atomicIncrement,
  • getRowsWithColumnsTs,
  • getScanner,
  • getTable,
  • getVer,
  • removeScanner,
  • scannerGetList,
  • append,
  • closeTable

Popular in Java

  • Making http requests using okhttp
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (Timer)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Notification (javax.management)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now