Package com.sun.sgs.impl.service.data.store.cache

Examples of com.sun.sgs.impl.service.data.store.cache.BindingKey


    public GetBindingResults getBinding(long nodeId, String name) {
  NodeInfo nodeInfo = nodeCallStarted(nodeId);
  try {
      checkNull("name", name);
      GetBindingResults results = null;
      BindingKey nextNameKey = null;
      /*
       * Since the implementation doesn't have range locking, find the
       * next key, lock it, and confirm that it is indeed the next key
       * after locking it, repeating as necessary.
       */
 
View Full Code Here


    {
  NodeInfo nodeInfo = nodeCallStarted(nodeId);
  try {
      checkNull("name", name);
      GetBindingForUpdateResults results = null;
      BindingKey key = null;
      for (int i = 0; true; i++) {
    if (i > MAX_RANGE_LOCK_RETRIES) {
        throw new ResourceUnavailableException("Too many retries");
    }
    DbTransaction txn = env.beginTransaction(txnTimeout);
View Full Code Here

    {
  NodeInfo nodeInfo = nodeCallStarted(nodeId);
  try {
      checkNull("name", name);
      GetBindingForRemoveResults results = null;
      BindingKey nameKey = BindingKey.get(name);
      BindingKey nextNameKey = null;
      for (int i = 0; true; i++) {
    if (i > MAX_RANGE_LOCK_RETRIES) {
        throw new ResourceUnavailableException("Too many retries");
    }
    DbTransaction txn = env.beginTransaction(txnTimeout);
View Full Code Here

    @Override
    public NextBoundNameResults nextBoundName(long nodeId, String name) {
  NodeInfo nodeInfo = nodeCallStarted(nodeId);
  try {
      NextBoundNameResults results = null;
      BindingKey nextNameKey = null;
      for (int i = 0; true; i++) {
    if (i > MAX_RANGE_LOCK_RETRIES) {
        throw new ResourceUnavailableException("Too many retries");
    }
    DbTransaction txn = env.beginTransaction(txnTimeout);
View Full Code Here

      throw new IllegalArgumentException(
          "The name values must not be less than -1");
        }
        String nextName = cursor.findNext(encodeString(name))
      ? decodeString(cursor.getKey()) : null;
        BindingKey nextKey = BindingKey.getAllowLast(nextName);
        if (value != -1) {
      /* Set -- next name must be write locked */
      checkLocked(nodeInfo, nextKey, true);
      if (!name.equals(nextName)) {
          lock(nodeInfo, BindingKey.get(name), true,
View Full Code Here

    new CacheConsistencyException(e.getMessage(), e);
      logger.logThrow(WARNING, exception, "Cache consistency failure");
      throw exception;
  }
  try {
      BindingKey nameKey = BindingKey.getAllowLast(name);
      checkLocked(nodeInfo, nameKey, false);
      releaseLock(nodeInfo, nameKey, "evict");
  } finally {
      nodeCallFinished(nodeInfo);
  }
View Full Code Here

    new CacheConsistencyException(e.getMessage(), e);
      logger.logThrow(WARNING, exception, "Cache consistency failure");
      throw exception;
  }
  try {
      BindingKey nameKey = BindingKey.getAllowLast(name);
      checkLocked(nodeInfo, nameKey, true);
      downgradeLock(nodeInfo, nameKey, "downgrade");
  } finally {
      nodeCallFinished(nodeInfo);
  }
View Full Code Here

TOP

Related Classes of com.sun.sgs.impl.service.data.store.cache.BindingKey

Copyright © 2018 www.massapicom. 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.