chenzhenyang opened a new issue, #3690:
URL: https://github.com/apache/bookkeeper/issues/3690

   DistributedLogManager distributedLogManager = namespace.openLog("stream2");
   AsyncLogWriter writer = 
FutureUtils.result(distributedLogManager.openAsyncLogWriter());
   byte[] data = 
"abdsfdsfdsfdsfasfdsfdsafaser324234243211v23rrcrevrevvtojr3n4ucrn4ru4rqnc".getBytes();
   Transaction.begin();
   LogRecord record = new LogRecord(System.currentTimeMillis(), data);
   Future<DLSN> writeFuture = writer.write(record);
   DLSN dlsn= writeFuture.get();
           String namespace = "tableservice_namespace";
           String tableName = "test";
           String key = "progress";
           DLSN dlsn = DLSN.InitialDLSN;
           StorageClientSettings settings = 
StorageClientSettingsInstance.SETTINGS;
   
           try (StorageClient client = StorageClientBuilder.newBuilder()
                   .withSettings(settings)
                   .withNamespace(namespace)
                   .build()) {
               try (Table<ByteBuf, ByteBuf> table = 
result(client.openTable(tableName))) {
                   result(table.put(
                           Unpooled.wrappedBuffer(key.getBytes(UTF_8)),
                           
Unpooled.wrappedBuffer(dlsn.toString().getBytes(UTF_8))));
                   System.out.println("Successfully update kv: ('" + key + "', 
'" + dlsn + "').");
               }
           } catch (Exception e) {
   //            log.error("Failed to process commands under namespace '{}'",
   //                    globalFlags.namespace, e);
   //            spec.console().println("Failed to process stream admin 
command");
   //            e.printStackTrace(spec.console());
               e.printStackTrace();
           }
   Transaction.commit();  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to