io.zeebe.db.ZeebeDb类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(81)

本文整理了Java中io.zeebe.db.ZeebeDb类的一些代码示例,展示了ZeebeDb类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZeebeDb类的具体详情如下:
包路径:io.zeebe.db.ZeebeDb
类名称:ZeebeDb

ZeebeDb介绍

[英]The zeebe database, to store key value pairs in different column families. The column families are defined via the specified ColumnFamilyType enum.

To access and store key-value pairs in a specific column family the user needs to create a ColumnFamily instance via #createColumnFamily(Enum,DbKey,DbValue). If the column family instances are created they are type save, which makes it possible that only the defined key and value types are stored in the column family.
[中]zeebe数据库,用于存储不同列族中的键值对。列族是通过指定的ColumnFamilyType枚举定义的。
要访问和存储特定列族中的键值对,用户需要通过#createColumnFamily(Enum、DbKey、DbValue)创建ColumnFamily实例。如果创建了柱族实例,则它们是类型保存,这使得柱族中仅存储定义的键和值类型成为可能。

代码示例

代码示例来源:origin: zeebe-io/zeebe

@Override
public void close() throws Exception {
 if (db != null) {
  db.close();
  db = null;
 }
}

代码示例来源:origin: zeebe-io/zeebe

public void create(final long key, final JobRecord record) {
 final DirectBuffer type = record.getType();
 zeebeDb.batch(() -> createJob(key, record, type));
}

代码示例来源:origin: zeebe-io/zeebe

public NextValueManager(
  long initialValue, ZeebeDb<ZbColumnFamilies> zeebeDb, ZbColumnFamilies columnFamily) {
 this.initialValue = initialValue;
 nextValueKey = new DbString();
 nextValue = new DbLong();
 nextValueColumnFamily = zeebeDb.createColumnFamily(columnFamily, nextValueKey, nextValue);
}

代码示例来源:origin: zeebe-io/zeebe

@Override
public void takeSnapshot(final StateSnapshotMetadata metadata) {
 if (db == null) {
  throw new IllegalStateException("Cannot create snapshot of not open database.");
 }
 if (exists(metadata)) {
  return;
 }
 final File snapshotDir = storage.getSnapshotDirectoryFor(metadata);
 db.createSnapshot(snapshotDir);
}

代码示例来源:origin: io.zeebe/zb-logstreams

@Override
public void takeSnapshot(final StateSnapshotMetadata metadata) {
 if (db == null) {
  throw new IllegalStateException("Cannot create snapshot of not open database.");
 }
 if (exists(metadata)) {
  return;
 }
 final File snapshotDir = storage.getSnapshotDirectoryFor(metadata);
 db.createSnapshot(snapshotDir);
}

代码示例来源:origin: io.zeebe/zeebe-broker-core

public void create(final long key, final JobRecord record) {
 final DirectBuffer type = record.getType();
 zeebeDb.batch(() -> createJob(key, record, type));
}

代码示例来源:origin: io.zeebe/zb-logstreams

@Override
public void close() throws Exception {
 if (db != null) {
  db.close();
  db = null;
 }
}

代码示例来源:origin: zeebe-io/zeebe

public ExporterStreamProcessorState(ZeebeDb<ExporterColumnFamilies> zeebeDb) {
 exporterId = new DbString();
 position = new DbLong();
 exporterPositionColumnFamily =
   zeebeDb.createColumnFamily(ExporterColumnFamilies.DEFAULT, exporterId, position);
}

代码示例来源:origin: zeebe-io/zeebe

public void resolve(long key, final JobRecord updatedValue) {
 final DirectBuffer type = updatedValue.getType();
 zeebeDb.batch(
   () -> {
    updateJobRecord(key, updatedValue);
    updateJobState(State.ACTIVATABLE);
    makeJobActivatable(type);
   });
}

代码示例来源:origin: zeebe-io/zeebe

@Override
protected void after() {
 try {
  db.close();
 } catch (Exception e) {
  throw new RuntimeException(e);
 }
}

代码示例来源:origin: io.zeebe/zeebe-broker-core

public ExporterStreamProcessorState(ZeebeDb<ExporterColumnFamilies> zeebeDb) {
 exporterId = new DbString();
 position = new DbLong();
 exporterPositionColumnFamily =
   zeebeDb.createColumnFamily(ExporterColumnFamilies.DEFAULT, exporterId, position);
}

代码示例来源:origin: io.zeebe/zeebe-broker-core

public void resolve(long key, final JobRecord updatedValue) {
 final DirectBuffer type = updatedValue.getType();
 zeebeDb.batch(
   () -> {
    updateJobRecord(key, updatedValue);
    updateJobState(State.ACTIVATABLE);
    makeJobActivatable(type);
   });
}

代码示例来源:origin: io.zeebe/zeebe-broker-core

@Override
protected void after() {
 try {
  db.close();
 } catch (Exception e) {
  throw new RuntimeException(e);
 }
}

代码示例来源:origin: io.zeebe/zeebe-broker-core

public NextValueManager(
  long initialValue, ZeebeDb<ZbColumnFamilies> zeebeDb, ZbColumnFamilies columnFamily) {
 this.initialValue = initialValue;
 nextValueKey = new DbString();
 nextValue = new DbLong();
 nextValueColumnFamily = zeebeDb.createColumnFamily(columnFamily, nextValueKey, nextValue);
}

代码示例来源:origin: zeebe-io/zeebe

public void timeout(final long key, final JobRecord record) {
 final DirectBuffer type = record.getType();
 final long deadline = record.getDeadline();
 validateParameters(type, deadline);
 zeebeDb.batch(
   () -> {
    createJob(key, record, type);
    removeJobDeadline(deadline);
   });
}

代码示例来源:origin: zeebe-io/zeebe

@After
public void tearDown() throws Exception {
 db.close();
}

代码示例来源:origin: zeebe-io/zeebe

public VariablesState(ZeebeDb<ZbColumnFamilies> zeebeDb) {
 parentKey = new DbLong();
 childKey = new DbLong();
 childParentColumnFamily =
   zeebeDb.createColumnFamily(
     ZbColumnFamilies.ELEMENT_INSTANCE_CHILD_PARENT, childKey, parentKey);
 scopeKey = new DbLong();
 variableName = new DbString();
 scopeKeyVariableNameKey = new DbCompositeKey<>(scopeKey, variableName);
 variable = new DbBufferView();
 variablesColumnFamily =
   zeebeDb.createColumnFamily(ZbColumnFamilies.VARIABLES, scopeKeyVariableNameKey, variable);
 payloadColumnFamily =
   zeebeDb.createColumnFamily(ZbColumnFamilies.PAYLOAD, payloadScopeKey, payload);
}

代码示例来源:origin: io.zeebe/zeebe-broker-core

public void timeout(final long key, final JobRecord record) {
 final DirectBuffer type = record.getType();
 final long deadline = record.getDeadline();
 validateParameters(type, deadline);
 zeebeDb.batch(
   () -> {
    createJob(key, record, type);
    removeJobDeadline(deadline);
   });
}

代码示例来源:origin: io.zeebe/zeebe-broker-core

@After
public void tearDown() throws Exception {
 db.close();
}

代码示例来源:origin: io.zeebe/zeebe-broker-core

public VariablesState(ZeebeDb<ZbColumnFamilies> zeebeDb) {
 parentKey = new DbLong();
 childKey = new DbLong();
 childParentColumnFamily =
   zeebeDb.createColumnFamily(
     ZbColumnFamilies.ELEMENT_INSTANCE_CHILD_PARENT, childKey, parentKey);
 scopeKey = new DbLong();
 variableName = new DbString();
 scopeKeyVariableNameKey = new DbCompositeKey<>(scopeKey, variableName);
 variable = new DbBufferView();
 variablesColumnFamily =
   zeebeDb.createColumnFamily(ZbColumnFamilies.VARIABLES, scopeKeyVariableNameKey, variable);
 payloadColumnFamily =
   zeebeDb.createColumnFamily(ZbColumnFamilies.PAYLOAD, payloadScopeKey, payload);
}

相关文章