Tabnine Logo
MetaStore$MetaStoreCallback.operationFailed
Code IndexAdd Tabnine to your IDE (free)

How to use
operationFailed
method
in
org.apache.bookkeeper.mledger.impl.MetaStore$MetaStoreCallback

Best Java code snippets using org.apache.bookkeeper.mledger.impl.MetaStore$MetaStoreCallback.operationFailed (Showing top 20 results out of 315)

origin: apache/pulsar

@Override
public void getCursors(final String ledgerName, final MetaStoreCallback<List<String>> callback) {
  if (log.isDebugEnabled()) {
    log.debug("[{}] Get cursors list", ledgerName);
  }
  zk.getChildren(prefix + ledgerName, false,
      (rc, path, ctx, children, stat) -> executor.executeOrdered(ledgerName, safeRun(() -> {
    if (log.isDebugEnabled()) {
      log.debug("[{}] getConsumers complete rc={} children={}", ledgerName, Code.get(rc), children);
    }
    if (rc != Code.OK.intValue()) {
      callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
      return;
    }
    if (log.isDebugEnabled()) {
      log.debug("[{}] Get childrend completed version={}", ledgerName, stat.getVersion());
    }
    callback.operationComplete(children, new ZKStat(stat));
  })), null);
}
origin: apache/pulsar

@Override
public void asyncGetCursorInfo(String ledgerName, String consumerName,
    final MetaStoreCallback<ManagedCursorInfo> callback) {
  String path = prefix + ledgerName + "/" + consumerName;
  if (log.isDebugEnabled()) {
    log.debug("Reading from {}", path);
  }
  zk.getData(path, false, (rc, path1, ctx, data, stat) -> executor.executeOrdered(ledgerName, safeRun(() -> {
    if (rc != Code.OK.intValue()) {
      callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
    } else {
      try {
        ManagedCursorInfo info = parseManagedCursorInfo(data);
        callback.operationComplete(info, new ZKStat(stat));
      } catch (ParseException | InvalidProtocolBufferException e) {
        callback.operationFailed(new MetaStoreException(e));
      }
    }
  })), null);
  if (log.isDebugEnabled()) {
    log.debug("Reading from {} ok", path);
  }
}
origin: apache/pulsar

@Override
public void removeManagedLedger(String ledgerName, MetaStoreCallback<Void> callback) {
  log.info("[{}] Remove ManagedLedger", ledgerName);
  zk.delete(prefix + ledgerName, -1, (rc, path, ctx) -> executor.executeOrdered(ledgerName, safeRun(() -> {
    if (log.isDebugEnabled()) {
      log.debug("[{}] zk delete done. rc={}", ledgerName, Code.get(rc));
    }
    if (rc == Code.OK.intValue()) {
      callback.operationComplete(null, null);
    } else {
      callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
    }
  })), null);
}
origin: com.yahoo.pulsar/managed-ledger

@Override
public void asyncUpdateLedgerIds(String ledgerName, ManagedLedgerInfo mlInfo, Stat stat,
    final MetaStoreCallback<Void> callback) {
  ZKStat zkStat = (ZKStat) stat;
  if (log.isDebugEnabled()) {
    log.debug("[{}] Updating metadata version={} with content={}", ledgerName, zkStat.version, mlInfo);
  }
  byte[] serializedMlInfo = protobufFormat == ZNodeProtobufFormat.Text ? //
      mlInfo.toString().getBytes(Encoding) : // Text format
      mlInfo.toByteArray(); // Binary format
  zk.setData(prefix + ledgerName, serializedMlInfo, zkStat.getVersion(),
      (rc, path, zkCtx, stat1) -> executor.submit(safeRun(() -> {
        if (log.isDebugEnabled()) {
          log.debug("[{}] UpdateLedgersIdsCallback.processResult rc={} newVersion={}", ledgerName,
              Code.get(rc), stat != null ? stat.getVersion() : "null");
        }
        MetaStoreException status = null;
        if (rc == Code.BADVERSION.intValue()) {
          // Content has been modified on ZK since our last read
          status = new BadVersionException(KeeperException.create(Code.get(rc)));
          callback.operationFailed(status);
        } else if (rc != Code.OK.intValue()) {
          status = new MetaStoreException(KeeperException.create(Code.get(rc)));
          callback.operationFailed(status);
        } else {
          callback.operationComplete(null, new ZKStat(stat1));
        }
      })), null);
}
origin: com.yahoo.pulsar/managed-ledger

@Override
public void getManagedLedgerInfo(final String ledgerName, final MetaStoreCallback<ManagedLedgerInfo> callback) {
  // Try to get the content or create an empty node
  zk.getData(prefix + ledgerName, false, (rc, path, ctx, readData, stat) -> executor.submit(safeRun(() -> {
    if (rc == Code.OK.intValue()) {
      try {
        ManagedLedgerInfo info = parseManagedLedgerInfo(readData);
        info = updateMLInfoTimestamp(info);
        callback.operationComplete(info, new ZKStat(stat));
      } catch (ParseException | InvalidProtocolBufferException e) {
        callback.operationFailed(new MetaStoreException(e));
      }
    } else if (rc == Code.NONODE.intValue()) {
      log.info("Creating '{}{}'", prefix, ledgerName);
      StringCallback createcb = (rc1, path1, ctx1, name) -> {
        if (rc1 == Code.OK.intValue()) {
          ManagedLedgerInfo info = ManagedLedgerInfo.getDefaultInstance();
          callback.operationComplete(info, new ZKStat());
        } else {
          callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc1))));
        }
      };
      ZkUtils.asyncCreateFullPathOptimistic(zk, prefix + ledgerName, new byte[0], Acl, CreateMode.PERSISTENT,
          createcb, null);
    } else {
      callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
    }
  })), null);
}
origin: com.yahoo.pulsar/managed-ledger

@Override
public void asyncGetCursorInfo(String ledgerName, String consumerName,
    final MetaStoreCallback<ManagedCursorInfo> callback) {
  String path = prefix + ledgerName + "/" + consumerName;
  if (log.isDebugEnabled()) {
    log.debug("Reading from {}", path);
  }
  zk.getData(path, false, (rc, path1, ctx, data, stat) -> executor.submit(safeRun(() -> {
    if (rc != Code.OK.intValue()) {
      callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
    } else {
      try {
        ManagedCursorInfo info = parseManagedCursorInfo(data);
        callback.operationComplete(info, new ZKStat(stat));
      } catch (ParseException | InvalidProtocolBufferException e) {
        callback.operationFailed(new MetaStoreException(e));
      }
    }
  })), null);
  if (log.isDebugEnabled()) {
    log.debug("Reading from {} ok", path);
  }
}
origin: org.apache.pulsar/managed-ledger-original

@Override
public void asyncGetCursorInfo(String ledgerName, String consumerName,
    final MetaStoreCallback<ManagedCursorInfo> callback) {
  String path = prefix + ledgerName + "/" + consumerName;
  if (log.isDebugEnabled()) {
    log.debug("Reading from {}", path);
  }
  zk.getData(path, false, (rc, path1, ctx, data, stat) -> executor.executeOrdered(ledgerName, safeRun(() -> {
    if (rc != Code.OK.intValue()) {
      callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
    } else {
      try {
        ManagedCursorInfo info = parseManagedCursorInfo(data);
        callback.operationComplete(info, new ZKStat(stat));
      } catch (ParseException | InvalidProtocolBufferException e) {
        callback.operationFailed(new MetaStoreException(e));
      }
    }
  })), null);
  if (log.isDebugEnabled()) {
    log.debug("Reading from {} ok", path);
  }
}
origin: com.yahoo.pulsar/managed-ledger

@Override
public void getCursors(final String ledgerName, final MetaStoreCallback<List<String>> callback) {
  if (log.isDebugEnabled()) {
    log.debug("[{}] Get cursors list", ledgerName);
  }
  zk.getChildren(prefix + ledgerName, false, (rc, path, ctx, children, stat) -> executor.submit(safeRun(() -> {
    if (log.isDebugEnabled()) {
      log.debug("[{}] getConsumers complete rc={} children={}", ledgerName, Code.get(rc), children);
    }
    if (rc != Code.OK.intValue()) {
      callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
      return;
    }
    if (log.isDebugEnabled()) {
      log.debug("[{}] Get childrend completed version={}", ledgerName, stat.getVersion());
    }
    callback.operationComplete(children, new ZKStat(stat));
  })), null);
}
origin: org.apache.pulsar/managed-ledger-original

@Override
public void getCursors(final String ledgerName, final MetaStoreCallback<List<String>> callback) {
  if (log.isDebugEnabled()) {
    log.debug("[{}] Get cursors list", ledgerName);
  }
  zk.getChildren(prefix + ledgerName, false,
      (rc, path, ctx, children, stat) -> executor.executeOrdered(ledgerName, safeRun(() -> {
    if (log.isDebugEnabled()) {
      log.debug("[{}] getConsumers complete rc={} children={}", ledgerName, Code.get(rc), children);
    }
    if (rc != Code.OK.intValue()) {
      callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
      return;
    }
    if (log.isDebugEnabled()) {
      log.debug("[{}] Get childrend completed version={}", ledgerName, stat.getVersion());
    }
    callback.operationComplete(children, new ZKStat(stat));
  })), null);
}
origin: com.yahoo.pulsar/managed-ledger

@Override
public void asyncRemoveCursor(final String ledgerName, final String consumerName,
    final MetaStoreCallback<Void> callback) {
  log.info("[{}] Remove consumer={}", ledgerName, consumerName);
  zk.delete(prefix + ledgerName + "/" + consumerName, -1, (rc, path, ctx) -> executor.submit(safeRun(() -> {
    if (log.isDebugEnabled()) {
      log.debug("[{}] [{}] zk delete done. rc={}", ledgerName, consumerName, Code.get(rc));
    }
    if (rc == Code.OK.intValue()) {
      callback.operationComplete(null, null);
    } else {
      callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
    }
  })), null);
}
origin: com.yahoo.pulsar/managed-ledger

@Override
public void removeManagedLedger(String ledgerName, MetaStoreCallback<Void> callback) {
  log.info("[{}] Remove ManagedLedger", ledgerName);
  zk.delete(prefix + ledgerName, -1, (rc, path, ctx) -> executor.submit(safeRun(() -> {
    if (log.isDebugEnabled()) {
      log.debug("[{}] zk delete done. rc={}", ledgerName, Code.get(rc));
    }
    if (rc == Code.OK.intValue()) {
      callback.operationComplete(null, null);
    } else {
      callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
    }
  })), null);
}
origin: org.apache.pulsar/managed-ledger-original

@Override
public void asyncRemoveCursor(final String ledgerName, final String consumerName,
    final MetaStoreCallback<Void> callback) {
  log.info("[{}] Remove consumer={}", ledgerName, consumerName);
  zk.delete(prefix + ledgerName + "/" + consumerName, -1,
      (rc, path, ctx) -> executor.executeOrdered(ledgerName, safeRun(() -> {
    if (log.isDebugEnabled()) {
      log.debug("[{}] [{}] zk delete done. rc={}", ledgerName, consumerName, Code.get(rc));
    }
    if (rc == Code.OK.intValue()) {
      callback.operationComplete(null, null);
    } else {
      callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
    }
  })), null);
}
origin: org.apache.pulsar/managed-ledger-original

@Override
public void removeManagedLedger(String ledgerName, MetaStoreCallback<Void> callback) {
  log.info("[{}] Remove ManagedLedger", ledgerName);
  zk.delete(prefix + ledgerName, -1, (rc, path, ctx) -> executor.executeOrdered(ledgerName, safeRun(() -> {
    if (log.isDebugEnabled()) {
      log.debug("[{}] zk delete done. rc={}", ledgerName, Code.get(rc));
    }
    if (rc == Code.OK.intValue()) {
      callback.operationComplete(null, null);
    } else {
      callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
    }
  })), null);
}
origin: com.yahoo.pulsar/managed-ledger

  @Override
  public void operationFailed(MetaStoreException e) {
    callback.operationFailed(e);
  }
});
origin: org.apache.pulsar/managed-ledger-original

  @Override
  public void operationFailed(MetaStoreException e) {
    callback.operationFailed(e);
  }
});
origin: apache/pulsar

      log.warn("[{}] Error creating cosumer {} node on meta-data store with {}: ", ledgerName,
          cursorName, info, Code.get(rc));
      callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
    } else {
      if (log.isDebugEnabled()) {
  (rc, path1, ctx, stat1) -> executor.executeOrdered(ledgerName, safeRun(() -> {
if (rc == Code.BADVERSION.intValue()) {
  callback.operationFailed(new BadVersionException(KeeperException.create(Code.get(rc))));
} else if (rc != Code.OK.intValue()) {
  callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
} else {
  callback.operationComplete(null, new ZKStat(stat1));
origin: apache/pulsar

  callback.operationComplete(info, new ZKStat(stat));
} catch (ParseException | InvalidProtocolBufferException e) {
  callback.operationFailed(new MetaStoreException(e));
      callback.operationComplete(info, new ZKStat());
    } else {
      callback.operationFailed(
          new MetaStoreException(KeeperException.create(Code.get(rc1))));
  callback.operationFailed(new ManagedLedgerException.MetadataNotFoundException(
      KeeperException.create(Code.get(rc))));
callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
origin: apache/pulsar

@Override
public void asyncUpdateLedgerIds(String ledgerName, ManagedLedgerInfo mlInfo, Stat stat,
    final MetaStoreCallback<Void> callback) {
  ZKStat zkStat = (ZKStat) stat;
  if (log.isDebugEnabled()) {
    log.debug("[{}] Updating metadata version={} with content={}", ledgerName, zkStat.version, mlInfo);
  }
  byte[] serializedMlInfo = mlInfo.toByteArray(); // Binary format
  zk.setData(prefix + ledgerName, serializedMlInfo, zkStat.getVersion(),
      (rc, path, zkCtx, stat1) -> executor.executeOrdered(ledgerName, safeRun(() -> {
        if (log.isDebugEnabled()) {
          log.debug("[{}] UpdateLedgersIdsCallback.processResult rc={} newVersion={}", ledgerName,
              Code.get(rc), stat != null ? stat.getVersion() : "null");
        }
        MetaStoreException status = null;
        if (rc == Code.BADVERSION.intValue()) {
          // Content has been modified on ZK since our last read
          status = new BadVersionException(KeeperException.create(Code.get(rc)));
          callback.operationFailed(status);
        } else if (rc != Code.OK.intValue()) {
          status = new MetaStoreException(KeeperException.create(Code.get(rc)));
          callback.operationFailed(status);
        } else {
          callback.operationComplete(null, new ZKStat(stat1));
        }
      })), null);
}
origin: apache/pulsar

@Override
public void asyncRemoveCursor(final String ledgerName, final String consumerName,
    final MetaStoreCallback<Void> callback) {
  log.info("[{}] Remove consumer={}", ledgerName, consumerName);
  zk.delete(prefix + ledgerName + "/" + consumerName, -1,
      (rc, path, ctx) -> executor.executeOrdered(ledgerName, safeRun(() -> {
    if (log.isDebugEnabled()) {
      log.debug("[{}] [{}] zk delete done. rc={}", ledgerName, consumerName, Code.get(rc));
    }
    if (rc == Code.OK.intValue()) {
      callback.operationComplete(null, null);
    } else {
      callback.operationFailed(new MetaStoreException(KeeperException.create(Code.get(rc))));
    }
  })), null);
}
origin: apache/pulsar

  @Override
  public void operationFailed(MetaStoreException e) {
    callback.operationFailed(e);
  }
});
org.apache.bookkeeper.mledger.implMetaStore$MetaStoreCallbackoperationFailed

Popular methods of MetaStore$MetaStoreCallback

  • operationComplete

Popular in Java

  • Reading from database using SQL prepared statement
  • getApplicationContext (Context)
  • putExtra (Intent)
  • compareTo (BigDecimal)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top 12 Jupyter Notebook extensions
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