Codota Logo
MetaStore$MetaStoreCallback.operationFailed
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
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: apache/pulsar

  @Override
  public void operationFailed(MetaStoreException e) {
    callback.operationFailed(e);
  }
});
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

      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: org.apache.pulsar/managed-ledger-original

  @Override
  public void operationFailed(MetaStoreException e) {
    callback.operationFailed(e);
  }
});
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 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: 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: 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: 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 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: 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: 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 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: 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: 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 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: 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);
}
org.apache.bookkeeper.mledger.implMetaStore$MetaStoreCallbackoperationFailed

Popular methods of MetaStore$MetaStoreCallback

  • operationComplete

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • getExternalFilesDir (Context)
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • BoxLayout (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
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