Codota Logo
MLDataFormats$ManagedCursorInfo$Builder.setCursorsLedgerId
Code IndexAdd Codota to your IDE (free)

How to use
setCursorsLedgerId
method
in
org.apache.bookkeeper.mledger.proto.MLDataFormats$ManagedCursorInfo$Builder

Best Java code snippets using org.apache.bookkeeper.mledger.proto.MLDataFormats$ManagedCursorInfo$Builder.setCursorsLedgerId (Showing top 9 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ArrayList a =
  • Codota Iconnew ArrayList<String>()
  • Codota Iconnew ArrayList()
  • Codota Iconnew ArrayList<Object>()
  • Smart code suggestions by Codota
}
origin: apache/pulsar

public Builder mergeFrom(org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo other) {
 if (other == org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo.getDefaultInstance()) return this;
 if (other.hasCursorsLedgerId()) {
  setCursorsLedgerId(other.getCursorsLedgerId());
origin: apache/pulsar

@Test(timeOut = 20000)
void updatingCursorNode() throws Exception {
  final MetaStore store = new MetaStoreImplZookeeper(zkc, executor);
  zkc.create("/managed-ledgers/my_test", "".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT);
  final CountDownLatch latch = new CountDownLatch(1);
  ManagedCursorInfo info = ManagedCursorInfo.newBuilder().setCursorsLedgerId(1).build();
  store.asyncUpdateCursorInfo("my_test", "c1", info, null, new MetaStoreCallback<Void>() {
    public void operationFailed(MetaStoreException e) {
      fail("should have succeeded");
    }
    public void operationComplete(Void result, Stat version) {
      // Update again using the version
      zkc.failNow(Code.CONNECTIONLOSS);
      ManagedCursorInfo info = ManagedCursorInfo.newBuilder().setCursorsLedgerId(2).build();
      store.asyncUpdateCursorInfo("my_test", "c1", info, version, new MetaStoreCallback<Void>() {
        public void operationFailed(MetaStoreException e) {
          // ok
          latch.countDown();
        }
        @Override
        public void operationComplete(Void result, Stat version) {
          fail("should have failed");
        }
      });
    }
  });
  latch.await();
}
origin: apache/pulsar

  public Object answer(InvocationOnMock invocation) {
    ManagedCursorInfo info = ManagedCursorInfo.newBuilder().setCursorsLedgerId(cursorsLedgerId)
        .setMarkDeleteLedgerId(markDeleteLedgerId).setMarkDeleteEntryId(markDeleteEntryId)
        .setLastActive(0L).build();
    Stat stat = mock(Stat.class);
    MetaStoreCallback<ManagedCursorInfo> callback = (MetaStoreCallback<ManagedCursorInfo>) invocation
        .getArguments()[2];
    callback.operationComplete(info, stat);
    return null;
  }
}).when(mockMetaStore).asyncGetCursorInfo(eq(mlName), eq(cursorName), any(MetaStoreCallback.class));
origin: apache/pulsar

  public void operationComplete(Void result, Stat version) {
    // Update again using the version
    zkc.failNow(Code.CONNECTIONLOSS);
    ManagedCursorInfo info = ManagedCursorInfo.newBuilder().setCursorsLedgerId(2).build();
    store.asyncUpdateCursorInfo("my_test", "c1", info, version, new MetaStoreCallback<Void>() {
      public void operationFailed(MetaStoreException e) {
        // ok
        latch.countDown();
      }
      @Override
      public void operationComplete(Void result, Stat version) {
        fail("should have failed");
      }
    });
  }
});
origin: apache/pulsar

private void persistPositionMetaStore(long cursorsLedgerId, PositionImpl position, Map<String, Long> properties,
    MetaStoreCallback<Void> callback, boolean persistIndividualDeletedMessageRanges) {
  // When closing we store the last mark-delete position in the z-node itself, so we won't need the cursor ledger,
  // hence we write it as -1. The cursor ledger is deleted once the z-node write is confirmed.
  ManagedCursorInfo.Builder info = ManagedCursorInfo.newBuilder() //
      .setCursorsLedgerId(cursorsLedgerId) //
      .setMarkDeleteLedgerId(position.getLedgerId()) //
      .setMarkDeleteEntryId(position.getEntryId()) //
      .setLastActive(lastActive); //
  info.addAllProperties(buildPropertiesMap(properties));
  if (persistIndividualDeletedMessageRanges) {
    info.addAllIndividualDeletedMessages(buildIndividualDeletedMessageRanges());
  }
  if (log.isDebugEnabled()) {
    log.debug("[{}][{}]  Closing cursor at md-position: {}", ledger.getName(), name, position);
  }
  ledger.getStore().asyncUpdateCursorInfo(ledger.getName(), name, info.build(), cursorLedgerStat,
      new MetaStoreCallback<Void>() {
        @Override
        public void operationComplete(Void result, Stat stat) {
          cursorLedgerStat = stat;
          callback.operationComplete(result, stat);
        }
        @Override
        public void operationFailed(MetaStoreException e) {
          callback.operationFailed(e);
        }
      });
}
origin: com.yahoo.pulsar/managed-ledger

private void persistPositionMetaStore(long cursorsLedgerId, PositionImpl position,
    MetaStoreCallback<Void> callback) {
  // When closing we store the last mark-delete position in the z-node itself, so we won't need the cursor ledger,
  // hence we write it as -1. The cursor ledger is deleted once the z-node write is confirmed.
  ManagedCursorInfo.Builder info = ManagedCursorInfo.newBuilder() //
      .setCursorsLedgerId(cursorsLedgerId) //
      .setMarkDeleteLedgerId(position.getLedgerId()) //
      .setMarkDeleteEntryId(position.getEntryId()); //
  if (protobufFormat == ZNodeProtobufFormat.Binary) {
    info.addAllIndividualDeletedMessages(buildIndividualDeletedMessageRanges());
  }
  if (log.isDebugEnabled()) {
    log.debug("[{}][{}]  Closing cursor at md-position: {}", ledger.getName(), name, markDeletePosition);
  }
  ledger.getStore().asyncUpdateCursorInfo(ledger.getName(), name, info.build(), cursorLedgerStat,
      new MetaStoreCallback<Void>() {
        @Override
        public void operationComplete(Void result, Stat stat) {
          callback.operationComplete(result, stat);
        }
        @Override
        public void operationFailed(MetaStoreException e) {
          callback.operationFailed(e);
        }
      });
}
origin: org.apache.pulsar/managed-ledger-original

private void persistPositionMetaStore(long cursorsLedgerId, PositionImpl position, Map<String, Long> properties,
    MetaStoreCallback<Void> callback, boolean persistIndividualDeletedMessageRanges) {
  // When closing we store the last mark-delete position in the z-node itself, so we won't need the cursor ledger,
  // hence we write it as -1. The cursor ledger is deleted once the z-node write is confirmed.
  ManagedCursorInfo.Builder info = ManagedCursorInfo.newBuilder() //
      .setCursorsLedgerId(cursorsLedgerId) //
      .setMarkDeleteLedgerId(position.getLedgerId()) //
      .setMarkDeleteEntryId(position.getEntryId()) //
      .setLastActive(lastActive); //
  info.addAllProperties(buildPropertiesMap(properties));
  if (persistIndividualDeletedMessageRanges) {
    info.addAllIndividualDeletedMessages(buildIndividualDeletedMessageRanges());
  }
  if (log.isDebugEnabled()) {
    log.debug("[{}][{}]  Closing cursor at md-position: {}", ledger.getName(), name, position);
  }
  ledger.getStore().asyncUpdateCursorInfo(ledger.getName(), name, info.build(), cursorLedgerStat,
      new MetaStoreCallback<Void>() {
        @Override
        public void operationComplete(Void result, Stat stat) {
          cursorLedgerStat = stat;
          callback.operationComplete(result, stat);
        }
        @Override
        public void operationFailed(MetaStoreException e) {
          callback.operationFailed(e);
        }
      });
}
origin: com.yahoo.pulsar/managed-ledger

public Builder mergeFrom(org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo other) {
 if (other == org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo.getDefaultInstance()) return this;
 if (other.hasCursorsLedgerId()) {
  setCursorsLedgerId(other.getCursorsLedgerId());
origin: org.apache.pulsar/managed-ledger-original

public Builder mergeFrom(org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo other) {
 if (other == org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo.getDefaultInstance()) return this;
 if (other.hasCursorsLedgerId()) {
  setCursorsLedgerId(other.getCursorsLedgerId());
org.apache.bookkeeper.mledger.protoMLDataFormats$ManagedCursorInfo$BuildersetCursorsLedgerId

Javadoc

 
If the ledger id is -1, then the mark-delete position is 
the one from the (ledgerId, entryId) snapshot below 
required int64 cursorsLedgerId = 1;

Popular methods of MLDataFormats$ManagedCursorInfo$Builder

  • build
  • setMarkDeleteEntryId
    optional int64 markDeleteEntryId = 3;
  • setMarkDeleteLedgerId
    Last snapshot of the mark-delete position optional int64 markDeleteLedgerId = 2;
  • <init>
  • addAllIndividualDeletedMessages
    repeated .MessageRange individualDeletedMessages = 4;
  • buildPartial
  • ensureIndividualDeletedMessagesIsMutable
  • getIndividualDeletedMessages
    repeated .MessageRange individualDeletedMessages = 4;
  • getIndividualDeletedMessagesCount
    repeated .MessageRange individualDeletedMessages = 4;
  • getIndividualDeletedMessagesFieldBuilder
  • getParentForChildren
  • hasCursorsLedgerId
    If the ledger id is -1, then the mark-delete position is the one from the (ledgerId, entryId) sna
  • getParentForChildren,
  • hasCursorsLedgerId,
  • isClean,
  • maybeForceBuilderInitialization,
  • mergeFrom,
  • mergeUnknownFields,
  • newUninitializedMessageException,
  • onBuilt,
  • onChanged

Popular in Java

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • JFrame (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • IsNull (org.hamcrest.core)
    Is the value null?
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