Пример #1
0
 static bool doGetAllFromStore(IEnumerable<byte[]> key,
                            Node node,
                            Store store,
             out IList<KeyedVersions> result)
 {
     result = null;
     try
     {
         result = store.getAll(key);
         node.SetAvailable(); //TODO: Check the cpp source for node and what's it's doing.
         return true;
     }
     catch (UnreachableStoreException ex)
     {
         if (log.IsErrorEnabled) log.Error("Exception while calling store.get on " + node, ex);
         node.SetDown();
     }
     catch (System.Net.Sockets.SocketException ex)
     {
         if (log.IsErrorEnabled) log.Error("Exception while calling store.get on " + node, ex);
         node.SetDown();
     }
     catch (Exception ex)
     {
         if (log.IsErrorEnabled) log.Error("Exception while calling store.get on " + node, ex);
         node.SetDown();
     }
     finally
     {
         node.Requests++;
     }
     return false;
 }
 protected override int GetPort(Node node)
 {
     throw new NotImplementedException();
 }
Пример #3
0
 static bool doDeleteFromStore(byte[] key,
                       Versioned version,
                       Node node,
                       Store store,
                       out bool result)
 {
     try
     {
         result = store.deleteKey(key, version);
         node.SetAvailable(); //TODO: Check the cpp source for node and what's it's doing.
         return true;
     }
     catch (UnreachableStoreException ex)
     {
         if (log.IsErrorEnabled) log.Error("Exception while calling store.get on " + node, ex);
         node.SetDown();
     }
     catch (System.Net.Sockets.SocketException ex)
     {
         if (log.IsErrorEnabled) log.Error("Exception while calling store.get on " + node, ex);
         node.SetDown();
     }
     catch (Exception ex)
     {
         if (log.IsErrorEnabled) log.Error("Exception while calling store.get on " + node, ex);
         node.SetDown();
     }
     finally
     {
         node.Requests++;
     }
     result = false;
     return false;
 }