Examples of writeSnapshot()


Examples of co.cask.tephra.persist.HDFSTransactionStateStorage.writeSnapshot()

        Maps.newTreeMap(ImmutableSortedMap.of(V[6], new TransactionManager.InProgressTx(V[6] - 1, Long.MAX_VALUE))),
        new HashMap<Long, Set<ChangeId>>(), new TreeMap<Long, Set<ChangeId>>());
    HDFSTransactionStateStorage tmpStorage =
      new HDFSTransactionStateStorage(conf, new SnapshotCodecProvider(conf));
    tmpStorage.startAndWait();
    tmpStorage.writeSnapshot(snapshot);
    tmpStorage.stopAndWait();
  }

  @AfterClass
  public static void shutdownAfterClass() throws Exception {
View Full Code Here

Examples of co.cask.tephra.persist.HDFSTransactionStateStorage.writeSnapshot()

        Maps.newTreeMap(ImmutableSortedMap.of(V[6], new TransactionManager.InProgressTx(V[6] - 1, Long.MAX_VALUE))),
        new HashMap<Long, Set<ChangeId>>(), new TreeMap<Long, Set<ChangeId>>());
    HDFSTransactionStateStorage tmpStorage =
      new HDFSTransactionStateStorage(conf, new SnapshotCodecProvider(conf));
    tmpStorage.startAndWait();
    tmpStorage.writeSnapshot(snapshot);
    tmpStorage.stopAndWait();
  }

  @AfterClass
  public static void shutdownAfterClass() throws Exception {
View Full Code Here

Examples of co.cask.tephra.persist.HDFSTransactionStateStorage.writeSnapshot()

        Maps.newTreeMap(ImmutableSortedMap.of(V[6], new TransactionManager.InProgressTx(V[6] - 1, Long.MAX_VALUE))),
        new HashMap<Long, Set<ChangeId>>(), new TreeMap<Long, Set<ChangeId>>());
    HDFSTransactionStateStorage tmpStorage =
      new HDFSTransactionStateStorage(conf, new SnapshotCodecProvider(conf));
    tmpStorage.startAndWait();
    tmpStorage.writeSnapshot(snapshot);
    tmpStorage.stopAndWait();
  }

  @AfterClass
  public static void shutdownAfterClass() throws Exception {
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobWriter.writeSnapshot()

        stateEngine.prepareForWrite();

        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        FastBlobWriter writer = new FastBlobWriter(stateEngine);
        writer.writeSnapshot(baos);

        FastBlobStateEngine deserializeEngine = typeAStateEngine();

        FastBlobReader reader = new FastBlobReader(deserializeEngine);
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobWriter.writeSnapshot()

        ByteArrayOutputStream reserializedStream = new ByteArrayOutputStream();

        FastBlobWriter rewriter = new FastBlobWriter(deserializeEngine);

        rewriter.writeSnapshot(reserializedStream);

        Assert.assertArrayEquals(baos.toByteArray(), reserializedStream.toByteArray());

        System.out.println(Arrays.toString(baos.toByteArray()));
        System.out.println(Arrays.toString(reserializedStream.toByteArray()));
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobWriter.writeSnapshot()

        DataOutputStream dataOutputStream = new DataOutputStream(baos);

        stateEngine.prepareForWrite();

        FastBlobWriter writer = new FastBlobWriter(stateEngine);
        writer.writeSnapshot(dataOutputStream);

        FastBlobReader reader = new FastBlobReader(stateEngine);
        reader.readSnapshot(new ByteArrayInputStream(baos.toByteArray()));

        return stateEngine;
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobWriter.writeSnapshot()

        stateEngine.prepareForWrite();

        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        FastBlobWriter writer = new FastBlobWriter(stateEngine);
        writer.writeSnapshot(baos);
        snapshot1 = baos.toByteArray();
        baos.reset();

        stateEngine.prepareForNextCycle();
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobWriter.writeSnapshot()

        writer.writeDelta(baos);
        delta = baos.toByteArray();
        baos.reset();

        writer.writeSnapshot(baos);
        snapshot2 = baos.toByteArray();
        baos.reset();

        /// we also create a broken delta chain to cause ordinal reassignments.
        stateEngine = newStateEngine();
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobWriter.writeSnapshot()

        addFs(1, 2, 4, 5, 6, 8, 9, 11, 12);

        stateEngine.prepareForWrite();

        writer = new FastBlobWriter(stateEngine);
        writer.writeSnapshot(baos);
        brokenDeltaChainSnapshot2 = baos.toByteArray();
   }

    private FastBlobStateEngine newStateEngine() {
        return new FastBlobStateEngine(new SerializerFactory() {
View Full Code Here

Examples of com.netflix.zeno.fastblob.io.FastBlobWriter.writeSnapshot()

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream outputStream = new DataOutputStream(baos);

        try {
            /// write the snapshot to the output stream.
            writer.writeSnapshot(outputStream);
        } catch(IOException e) {
            /// the FastBlobWriter throws an IOException if it is
            /// unable to write to the provided OutputStream
        } finally {
            /// it is your responsibility to close the stream.  The FastBlobWriter will not do this.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.