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

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Gson g =
  • Codota Iconnew Gson()
  • Codota IconGsonBuilder gsonBuilder;gsonBuilder.create()
  • Codota Iconnew GsonBuilder().create()
  • Smart code suggestions by Codota
}
origin: apache/pulsar

long ledgerId = info.getCursorsLedgerId();
bookkeeper.asyncOpenLedger(ledgerId, digestType, config.getPassword(), (rc, lh, ctx) -> {
  if (log.isDebugEnabled()) {
origin: apache/pulsar

@Override
public void operationComplete(ManagedCursorInfo result, Stat stat) {
  individualDeletedMessagesCount.set(result.getIndividualDeletedMessagesCount());
  latch.countDown();
}
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: org.apache.pulsar/managed-ledger-original

private ManagedCursorInfo parseManagedCursorInfo(byte[] data)
    throws ParseException, InvalidProtocolBufferException {
  // First try binary format, then fallback to text
  try {
    return ManagedCursorInfo.parseFrom(data);
  } catch (InvalidProtocolBufferException e) {
    // Fallback to parsing protobuf text format
    ManagedCursorInfo.Builder builder = ManagedCursorInfo.newBuilder();
    TextFormat.merge(new String(data, Encoding), builder);
    return builder.build();
  }
}
origin: com.yahoo.pulsar/managed-ledger

public static org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo parseDelimitedFrom(
  java.io.InputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 Builder builder = newBuilder();
 if (builder.mergeDelimitedFrom(input, extensionRegistry)) {
  return builder.buildParsed();
 } else {
  return null;
 }
}
public static org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo parseFrom(
origin: com.yahoo.pulsar/managed-ledger

private ManagedCursorInfo parseManagedCursorInfoFromText(byte[] data) throws ParseException {
  ManagedCursorInfo.Builder builder = ManagedCursorInfo.newBuilder();
  TextFormat.merge(new String(data, Encoding), builder);
  return builder.build();
}
origin: com.yahoo.pulsar/managed-ledger

public static org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo parseFrom(
  com.google.protobuf.ByteString data,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws com.google.protobuf.InvalidProtocolBufferException {
 return newBuilder().mergeFrom(data, extensionRegistry)
      .buildParsed();
}
public static org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo parseFrom(byte[] data)
origin: com.yahoo.pulsar/managed-ledger

public static Builder newBuilder(org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo prototype) {
 return newBuilder().mergeFrom(prototype);
}
public Builder toBuilder() { return newBuilder(this); }
origin: com.yahoo.pulsar/managed-ledger

public com.google.protobuf.Descriptors.Descriptor
  getDescriptorForType() {
 return org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo.getDescriptor();
}

origin: org.apache.pulsar/managed-ledger-original

public org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo getDefaultInstanceForType() {
 return org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo.getDefaultInstance();
}
origin: com.yahoo.pulsar/managed-ledger

public org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo getDefaultInstanceForType() {
 return org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo.getDefaultInstance();
}

origin: com.yahoo.pulsar/managed-ledger

private ManagedCursorInfo parseManagedCursorInfoFromBinary(byte[] data) throws InvalidProtocolBufferException {
  return ManagedCursorInfo.newBuilder().mergeFrom(data).build();
}
origin: com.yahoo.pulsar/managed-ledger

public Builder toBuilder() { return newBuilder(this); }

origin: com.yahoo.pulsar/managed-ledger

public static org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo parseFrom(
  java.io.InputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 return newBuilder().mergeFrom(input, extensionRegistry)
      .buildParsed();
}
public static org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo parseDelimitedFrom(java.io.InputStream input)
origin: org.apache.pulsar/managed-ledger-original

public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
origin: com.yahoo.pulsar/managed-ledger

public static org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo parseFrom(
  com.google.protobuf.CodedInputStream input,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws java.io.IOException {
 return newBuilder().mergeFrom(input, extensionRegistry)
      .buildParsed();
}

origin: com.yahoo.pulsar/managed-ledger

public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder(org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo prototype) {
origin: com.yahoo.pulsar/managed-ledger

public static org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo parseFrom(
  byte[] data,
  com.google.protobuf.ExtensionRegistryLite extensionRegistry)
  throws com.google.protobuf.InvalidProtocolBufferException {
 return newBuilder().mergeFrom(data, extensionRegistry)
      .buildParsed();
}
public static org.apache.bookkeeper.mledger.proto.MLDataFormats.ManagedCursorInfo parseFrom(java.io.InputStream input)
origin: com.yahoo.pulsar/managed-ledger

public final boolean isInitialized() {
 byte isInitialized = memoizedIsInitialized;
 if (isInitialized != -1) return isInitialized == 1;
 
 if (!hasCursorsLedgerId()) {
  memoizedIsInitialized = 0;
  return false;
 }
 for (int i = 0; i < getIndividualDeletedMessagesCount(); i++) {
  if (!getIndividualDeletedMessages(i).isInitialized()) {
   memoizedIsInitialized = 0;
   return false;
  }
 }
 memoizedIsInitialized = 1;
 return true;
}

origin: org.apache.pulsar/managed-ledger-original

/**
 * If we fail to recover the cursor ledger, we want to still open the ML and rollback.
 *
 * @param info
 */
private PositionImpl getRollbackPosition(ManagedCursorInfo info) {
  PositionImpl firstPosition = ledger.getFirstPosition();
  PositionImpl snapshottedPosition = new PositionImpl(info.getMarkDeleteLedgerId(), info.getMarkDeleteEntryId());
  if (firstPosition == null) {
    // There are no ledgers in the ML, any position is good
    return snapshottedPosition;
  } else if (snapshottedPosition.compareTo(firstPosition) < 0) {
    // The snapshotted position might be pointing to a ledger that was already deleted
    return firstPosition;
  } else {
    return snapshottedPosition;
  }
}
org.apache.bookkeeper.mledger.protoMLDataFormats$ManagedCursorInfo

Javadoc

Protobuf type ManagedCursorInfo

Most used methods

  • getCursorsLedgerId
    If the ledger id is -1, then the mark-delete position is the one from the (ledgerId, entryId) sna
  • getIndividualDeletedMessagesCount
    repeated .MessageRange individualDeletedMessages = 4;
  • newBuilder
  • <init>
  • getDefaultInstance
  • getDescriptor
  • getIndividualDeletedMessages
    repeated .MessageRange individualDeletedMessages = 4;
  • getIndividualDeletedMessagesList
    repeated .MessageRange individualDeletedMessages = 4;
  • getMarkDeleteEntryId
    optional int64 markDeleteEntryId = 3;
  • getMarkDeleteLedgerId
    Last snapshot of the mark-delete position optional int64 markDeleteLedgerId = 2;
  • hasCursorsLedgerId
    If the ledger id is -1, then the mark-delete position is the one from the (ledgerId, entryId) sna
  • hasMarkDeleteEntryId
    optional int64 markDeleteEntryId = 3;
  • hasCursorsLedgerId,
  • hasMarkDeleteEntryId,
  • hasMarkDeleteLedgerId,
  • isInitialized,
  • toByteArray,
  • getLastActive,
  • getProperties,
  • getPropertiesCount,
  • getPropertiesList,
  • getSerializedSize

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSystemService (Context)
  • getExternalFilesDir (Context)
  • getContentResolver (Context)
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • JPanel (javax.swing)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
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