Tabnine Logo
Versioned.getValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getValue
method
in
voldemort.versioning.Versioned

Best Java code snippets using voldemort.versioning.Versioned.getValue (Showing top 20 results out of 315)

origin: voldemort/voldemort

@SuppressWarnings("unchecked")
public List<StoreDefinition> getRebalancingSourceStores() {
  // acquire read lock
  readLock.lock();
  try {
    return (List<StoreDefinition>) metadataCache.get(REBALANCING_SOURCE_STORES_XML)
                          .getValue();
  } finally {
    readLock.unlock();
  }
}
origin: voldemort/voldemort

public boolean getSlopStreamingEnabledUnlocked() {
  return Boolean.parseBoolean(metadataCache.get(SLOP_STREAMING_ENABLED_KEY)
                       .getValue()
                       .toString());
}
origin: voldemort/voldemort

public boolean getQuotaEnforcingEnabledUnlocked() {
  return Boolean.parseBoolean(metadataCache.get(QUOTA_ENFORCEMENT_ENABLED_KEY)
                       .getValue()
                       .toString());
}
origin: voldemort/voldemort

public RebalancerState getRebalancerState() {
  // acquire read lock
  readLock.lock();
  try {
    return (RebalancerState) metadataCache.get(REBALANCING_STEAL_INFO).getValue();
  } finally {
    readLock.unlock();
  }
}
origin: voldemort/voldemort

public UpdateElementById(VListKey<K> key, Versioned<E> element) {
  _key = key;
  _element = element.getValue();
  _version = element.getVersion();
}
origin: voldemort/voldemort

public static void writeResults(DataOutputStream outputStream, List<Versioned<byte[]>> values)
    throws IOException {
  outputStream.writeInt(values.size());
  for(Versioned<byte[]> v: values) {
    byte[] clock = ((VectorClock) v.getVersion()).toBytes();
    byte[] value = v.getValue();
    outputStream.writeInt(clock.length + value.length);
    outputStream.write(clock);
    outputStream.write(value);
  }
}
origin: voldemort/voldemort

@Override
public void put(K key, Versioned<byte[]> value, byte[] transforms) throws VoldemortException {
  try {
    getInnerStore().put(key,
              new Versioned<byte[]>(IOUtils.toByteArray(new GZIPInputStream(new ByteArrayInputStream(value.getValue()))),
                         value.getVersion()),
              transforms);
  } catch(IOException e) {
    throw new VoldemortException(e);
  }
}
origin: voldemort/voldemort

public static int getResultsSize(List<Versioned<byte[]>> values) {
  int size = 4;
  for(Versioned<byte[]> v: values) {
    size += 4;
    size += ((VectorClock) v.getVersion()).sizeInBytes();
    size += v.getValue().length;
  }
  return size;
}
origin: voldemort/voldemort

private static List<StoreDefinition> getStoreDefinitions(AdminClient adminClient, int nodeId) {
  Versioned<List<StoreDefinition>> storeDefs = null;
  if(nodeId >= 0) {
    storeDefs = adminClient.metadataMgmtOps.getRemoteStoreDefList(nodeId);
  } else {
    storeDefs = adminClient.metadataMgmtOps.getRemoteStoreDefList();
  }
  return storeDefs.getValue();
}
origin: voldemort/voldemort

/**
 * @param versioned Versioned value with version information and value
 *        itself
 */
public HashedValue(Versioned<byte[]> versioned) {
  innerVersion = versioned.getVersion();
  valueHash = new FnvHashFunction().hash(versioned.getValue());
}
origin: voldemort/voldemort

/**
 * Get the ver
 * 
 * @param id
 * @return
 */
public Versioned<E> getVersionedById(int id) {
  Versioned<VListNode<E>> listNode = getListNode(id);
  if(listNode == null)
    throw new IndexOutOfBoundsException();
  return new Versioned<E>(listNode.getValue().getValue(), listNode.getVersion());
}
origin: voldemort/voldemort

@Override
public List<Versioned<V>> get(K key, T transforms) throws VoldemortException {
  List<Versioned<byte[]>> found = store.get(keyToBytes(key),
                       (transformsSerializer != null && transforms != null) ? transformsSerializer.toBytes(transforms)
                                                 : null);
  List<Versioned<V>> results = new ArrayList<Versioned<V>>(found.size());
  for(Versioned<byte[]> versioned: found)
    results.add(new Versioned<V>(valueSerializer.toObject(versioned.getValue()),
                   versioned.getVersion()));
  return results;
}
origin: voldemort/voldemort

public static VProto.Versioned.Builder encodeVersioned(Versioned<byte[]> versioned) {
  return VProto.Versioned.newBuilder()
              .setValue(ByteString.copyFrom(versioned.getValue()))
              .setVersion(ProtoUtils.encodeClock(versioned.getVersion()));
}
origin: voldemort/voldemort

private Versioned<byte[]> incremented(Versioned<byte[]> versioned, int nodeId) {
  return new Versioned<byte[]>(versioned.getValue(),
                 ((VectorClock) versioned.getVersion()).incremented(nodeId,
                                          time.getMilliseconds()));
}
origin: voldemort/voldemort

@Override
public void verifyConnection(Node node) throws UnreachableStoreException, VoldemortException {
  Integer returnNodeId = Integer.parseInt(getAdminClient().metadataMgmtOps.getRemoteMetadata(node.getId(),
                                                MetadataStore.NODE_ID_KEY)
                                      .getValue());
  if(returnNodeId != node.getId()) {
    throw new VoldemortException("Incorrect node id " + returnNodeId
                   + " returned from node " + node.getId());
  }
}
origin: voldemort/voldemort

  @Test
  public void testGetAll() {
    Versioned<String> r0 = storeClient.get("a");
    assertEquals("1", r0.getValue());
    rebalance();
    Map<String, Versioned<String>> res = storeClient.getAll(ImmutableList.of("a", "b"));

    assertTrue("getAll() contains a", res.containsKey("a"));
    assertTrue("getAll() contains b", res.containsKey("b"));
    assertEquals("getAll() returns correct value #1", "1", res.get("a").getValue());
    assertEquals("getAll() returns correct value #2", "2", res.get("b").getValue());
  }
}
origin: voldemort/voldemort

private void validateQuota(String storeName){
 AdminClient adminClient = getAdminClient();
 Versioned<String> value = adminClient.quotaMgmtOps.getQuota(storeName, QuotaType.STORAGE_SPACE);
 assertEquals("Default storage quota does not match", Long.toString(defaultStoreQuota), value.getValue());
}
origin: voldemort/voldemort

@Test
public void testAllUp() {
  try {
    List<Versioned<String>> versioneds = client.get("K1", null);
    assertEquals(versioneds.get(0).getValue(), "V1");
  } catch(InsufficientOperationalNodesException e) {
    fail("Failed with exception: " + e);
  }
}
origin: voldemort/voldemort

private void populateSlops(List<Versioned<Slop>> slops) {
  for(Versioned<Slop> slop: slops) {
    VectorClock clock = TestUtils.getClock(1);
    NodeValue<ByteArray, byte[]> nodeValue = new NodeValue<ByteArray, byte[]>(PURGE_SERVER_ID,
                                         slop.getValue()
                                           .makeKey(),
                                         new Versioned<byte[]>(slopSerializer.toBytes(slop.getValue()),
                                                    clock));
    adminClient.storeOps.putNodeKeyValue("slop", nodeValue);
  }
}
origin: voldemort/voldemort

@Test
public void testPut() {
  Versioned<String> r0 = storeClient.get("a");
  assertEquals("1", r0.getValue());
  rebalance();
  storeClient.put("c", "3");
  assertEquals("put() okay after re-bootstrap", "3", storeClient.get("c").getValue());
}
voldemort.versioningVersionedgetValue

Popular methods of Versioned

  • <init>
  • getVersion
  • setObject
  • value
  • cloneVersioned
    Create a clone of this Versioned object such that the object pointed to is the same, but the VectorC
  • equals
  • hashCode
  • toString

Popular in Java

  • Reading from database using SQL prepared statement
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getExternalFilesDir (Context)
  • getSharedPreferences (Context)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • 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
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • From CI to AI: The AI layer in your organization
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