Codota Logo
KryoManager.deserialize
Code IndexAdd Codota to your IDE (free)

How to use
deserialize
method
in
org.chronos.common.serialization.KryoManager

Best Java code snippets using org.chronos.common.serialization.KryoManager.deserialize (Showing top 11 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: MartinHaeusler/chronos

@Override
public Object getValue() {
  if (this.value == null) {
    return null;
  }
  return KryoManager.deserialize(this.value);
}
origin: MartinHaeusler/chronos

@Override
public Object deserialize(final byte[] serialForm) {
  return KryoManager.deserialize(serialForm);
}
origin: MartinHaeusler/chronos

public Object getValue() {
  return KryoManager.deserialize(this.value);
}
origin: MartinHaeusler/chronos

public Indexer<?> getIndexer() {
  if (this.indexerData == null) {
    return null;
  } else {
    byte[] serialForm = Base64.getDecoder().decode(this.indexerData);
    return KryoManager.deserialize(serialForm);
  }
}
origin: MartinHaeusler/chronos

public static IBranchMetadata getMetadata(final TuplTransaction tx, final String name) {
  checkNotNull(tx, "Precondition violation - argument 'tx' must not be NULL!");
  checkNotNull(name, "Precondition violation - argument 'name' must not be NULL!");
  byte[] loadedValue = tx.load(NAME, name);
  if (loadedValue == null) {
    return null;
  }
  return KryoManager.deserialize(loadedValue);
}
origin: MartinHaeusler/chronos

/**
 * Returns the map from keyspace name to matrix map name for the given branch.
 *
 * @param tx
 *            The transaction to work on. Must not be <code>null</code>, must be open.
 * @param branchName
 *            The name of the branch to get the keyspace-to-matrix-name map for. Must not be <code>null</code>, must
 *            refer to an existing branch.
 *
 * @return The metadata for all known keyspaces in the given branch.
 *
 * @throws ChronoDBBranchingException
 *             Thrown if there is no branch with the given name.
 */
public static Set<KeyspaceMetadata> getKeyspaceMetadata(final TuplTransaction tx, final String branchName)
    throws ChronoDBBranchingException {
  checkNotNull(tx, "Precondition violation - argument 'tx' must not be NULL!");
  checkNotNull(branchName, "Precondition violation - argument 'branchName' must not be NULL!");
  assertBranchExists(tx, branchName);
  byte[] keyspaceToMetadata = tx.load(NAME, branchName);
  if (keyspaceToMetadata == null) {
    return Sets.newHashSet();
  }
  Map<String, KeyspaceMetadata> map = KryoManager.deserialize(keyspaceToMetadata);
  return Sets.newHashSet(map.values());
}
origin: MartinHaeusler/chronos

keyspaceToMetadata = KryoManager.deserialize(keyspaceToMatrixBinary);
origin: MartinHaeusler/chronos

public static Set<IBranchMetadata> values(final TuplTransaction tx) {
  checkNotNull(tx, "Precondition violation - argument 'tx' must not be NULL!");
  Set<IBranchMetadata> resultSet = Sets.newHashSet();
  Cursor cursor = tx.newCursorOn(NAME);
  try {
    cursor.first();
    if (cursor.key() == null) {
      // index is empty, return empty result set
      return resultSet;
    }
    while (cursor.key() != null) {
      byte[] value = cursor.value();
      if (value != null) {
        IBranchMetadata branchMetadata = KryoManager.deserialize(value);
        resultSet.add(branchMetadata);
      }
      cursor.next();
    }
    return resultSet;
  } catch (IOException ioe) {
    throw new ChronosIOException("Failed to load branch metadata! See root cause for details.", ioe);
  } finally {
    if (cursor != null) {
      cursor.reset();
    }
  }
}
origin: MartinHaeusler/chronos

@Test
public void canSerializeAndDeserialize() {
  Person johnDoe = new Person("John", "Doe");
  byte[] bytes = KryoManager.serialize(johnDoe);
  assertNotNull(bytes);
  Person deserialized = KryoManager.deserialize(bytes);
  assertEquals(johnDoe, deserialized);
}
origin: MartinHaeusler/chronos

@Test
@SuppressWarnings("unchecked")
public void canSerializeAndDeserializeMultipleTrees() {
  ImmutableMap<String, String> map = ImmutableMaps.newHashArrayMappedTreeMap();
  ImmutableMap<String, String> map1 = map.put("Hello", "World");
  ImmutableMap<String, String> map2 = map.put("Foo", "Bar");
  ImmutableMap<String, String> map3 = map.put("Number", "42");
  List<ImmutableMap<String, String>> allVersions = Lists.newArrayList(map, map1, map2, map3);
  byte[] bytes = KryoManager.serialize(allVersions);
  List<ImmutableMap<String, String>> allVersions2 = KryoManager.deserialize(bytes);
  assertNotNull(allVersions2);
  assertEquals(allVersions, allVersions2);
}
origin: MartinHaeusler/chronos

@Test
public void canSerializeAndDeserializeSingleTree() {
  ImmutableMap<String, String> map = ImmutableMaps.newHashArrayMappedTreeMap();
  map = map.put("Hello", "World");
  map = map.put("Foo", "Bar");
  map = map.put("Number", "42");
  byte[] bytes = KryoManager.serialize(map);
  ImmutableMap<String, String> map2 = KryoManager.deserialize(bytes);
  assertNotNull(map2);
  assertEquals(map.entrySet(), map2.entrySet());
  for (Entry<String, String> entry : map.entrySet()) {
    assertEquals(entry.getValue(), map2.get(entry.getKey()));
  }
  for (Entry<String, String> entry : map2.entrySet()) {
    assertEquals(entry.getValue(), map.get(entry.getKey()));
  }
}
org.chronos.common.serializationKryoManagerdeserialize

Popular methods of KryoManager

  • serialize
  • deepCopy
  • deserializeObjectsFromFile
  • serializeObjectsToFile
  • deserializeObjectFromFile
  • destroyKryo
  • getKryo
  • produceKryoWrapper

Popular in Java

  • Start an intent from android
  • putExtra (Intent)
  • onCreateOptionsMenu (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Path (java.nio.file)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now