コード例 #1
0
ファイル: TxBB.java プロジェクト: leloulight/gemfirexd-oss
 /** Get the update strategy. */
 public static String getUpdateStrategy() {
   String strategy = (String) (TxBB.getBB().getSharedMap().get(UpdateStrategy));
   if (strategy == null) {
     strategy = TxPrms.getUpdateStrategy();
     TxBB.getBB().getSharedMap().put(UpdateStrategy, strategy);
     Log.getLogWriter().info("Update strategy is " + strategy);
   }
   return strategy;
 }
コード例 #2
0
 /** Initialize the key ranges */
 public void initialize() {
   long uniqueKeyCounter =
       TxBB.getBB().getSharedCounters().incrementAndRead(TxBB.UniqueKeyCounter);
   int lower = (int) (((uniqueKeyCounter - 1) * KEY_RANGE) + 1);
   int upper = (int) (uniqueKeyCounter * KEY_RANGE);
   lowerKeyRange.set(new Integer(lower));
   upperKeyRange.set(new Integer(upper));
   Log.getLogWriter()
       .info(
           "LowerKeyRange is "
               + lowerKeyRange.get()
               + ", upperKeyRange is "
               + upperKeyRange.get());
   super.initialize();
 }
コード例 #3
0
ファイル: TxBB.java プロジェクト: leloulight/gemfirexd-oss
 /** Increment the given counter */
 public static void inc(int whichCounter) {
   TxBB.getBB().getSharedCounters().increment(whichCounter);
 }
コード例 #4
0
ファイル: TxBB.java プロジェクト: leloulight/gemfirexd-oss
 /**
  * Return the expected commit success/failure for the current thread.
  *
  * @returns true if the current thread should succeed in its commit, false otherwise.
  */
 public static boolean getCommitStatus() {
   Object key = TxBB.CommitStatusKey + Thread.currentThread().getName();
   Object result = TxBB.getBB().getSharedMap().get(key);
   if (result instanceof Boolean) return ((Boolean) result).booleanValue();
   else throw new TestException("Unknown value " + result + " for TxBB sharedMap key " + key);
 }
コード例 #5
0
ファイル: TxBB.java プロジェクト: leloulight/gemfirexd-oss
 /**
  * Write to the blackboard the expected commit success/failure for the current thread.
  *
  * @param expectCommitStatus True if we expect the current thread to successfully commit, false
  *     otherwise.
  */
 public static void recordCommitStatus(boolean expectCommitStatus) {
   Object key = TxBB.CommitStatusKey + Thread.currentThread().getName();
   TxBB.getBB().getSharedMap().put(key, new Boolean(expectCommitStatus));
   Log.getLogWriter().info("Written to TxBB: " + key + ", " + expectCommitStatus);
 }
コード例 #6
0
ファイル: TxBB.java プロジェクト: leloulight/gemfirexd-oss
 /** Convenience method for reading the list of operations for the current client thread. */
 public static OpList getOpList() {
   Object key = OpListKey + Thread.currentThread().getName();
   OpList opList = (OpList) (TxBB.getBB().getSharedMap().get(key));
   Log.getLogWriter().info("TxBB read from shared map key " + key + ", value " + opList);
   return opList;
 }
コード例 #7
0
ファイル: TxBB.java プロジェクト: leloulight/gemfirexd-oss
 /** Convenience method for writing a list of operations for the current client thread. */
 public static void putOpList(OpList opList) {
   Object key = OpListKey + Thread.currentThread().getName();
   TxBB.getBB().getSharedMap().put(key, opList);
   Log.getLogWriter().info("TxBB put into shared map key " + key + ", value " + opList);
 }