proj_name
stringclasses
131 values
relative_path
stringlengths
30
228
class_name
stringlengths
1
68
func_name
stringlengths
1
48
masked_class
stringlengths
78
9.82k
func_body
stringlengths
46
9.61k
len_input
int64
29
2.01k
len_output
int64
14
1.94k
total
int64
55
2.05k
relevant_context
stringlengths
0
38.4k
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdb/OpenedRocksDB.java
CFHandle
waitForDrop
class CFHandle implements AutoCloseable { private final ColumnFamilyHandle handle; private final AtomicInteger refs; private final RocksDBIteratorPool iterPool; public CFHandle(RocksDB rocksdb, ColumnFamilyHandle handle) { E.checkNotNull(handle, "handle"); this....
assert this.refs.get() >= 1; // When entering this method, the refs won't increase anymore final long timeout = TimeUnit.MINUTES.toMillis(30L); final long unit = 100L; for (long i = 1; this.refs.get() > 1; i++) { try { Thre...
385
184
569
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdb/RocksDBFeatures.java
RocksDBFeatures
supportsQueryWithContainsKey
class RocksDBFeatures implements BackendFeatures { @Override public boolean supportsSharedStorage() { return false; } @Override public boolean supportsSnapshot() { return true; } @Override public boolean supportsScanToken() { return false; } @Override ...
// TODO: Need to traversal all items return false;
624
20
644
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdb/RocksDBIngester.java
RocksDBIngester
ingest
class RocksDBIngester { public static final String SST = ".sst"; private static final Logger LOG = Log.logger(RocksDBIngester.class); private final RocksDB rocksdb; private final IngestExternalFileOptions options; public RocksDBIngester(RocksDB rocksdb) { this.rocksdb = rocksdb; ...
SuffixFileVisitor visitor = new SuffixFileVisitor(SST); try { Files.walkFileTree(path, visitor); } catch (IOException e) { throw new BackendException("Failed to walk path '%s'", e, path); } List<Path> files = visitor.files(); List<String> ssts = ...
430
185
615
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdb/RocksDBIteratorPool.java
RocksDBIteratorPool
refreshIterator
class RocksDBIteratorPool implements AutoCloseable { private static final Logger LOG = Log.logger(RocksDBIteratorPool.class); private static final int ITERATOR_POOL_CAPACITY = CoreOptions.CPUS * 2; private final Queue<RocksIterator> pool; private final RocksDB rocksdb; private final ColumnFamilyH...
if (iter.isOwningHandle()) { try { iter.refresh(); return true; } catch (RocksDBException e) { LOG.warn("Can't refresh RocksIterator: {}", e.getMessage(), e); } } return false;
1,135
77
1,212
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdb/RocksDBStoreProvider.java
RocksDBStoreProvider
driverVersion
class RocksDBStoreProvider extends AbstractBackendStoreProvider { protected String database() { return this.graph().toLowerCase(); } @Override protected BackendStore newSchemaStore(HugeConfig config, String store) { return new RocksDBStore.RocksDBSchemaStore(this, this.database(), stor...
/* * Versions history: * [1.0] HugeGraph-1328: supports backend table version checking * [1.1] HugeGraph-1322: add support for full-text search * [1.2] #296: support range sortKey feature * [1.3] #270 & #398: support shard-index and vertex + sortkey prefix, ...
494
318
812
<methods>public non-sealed void <init>() ,public void clear() throws org.apache.hugegraph.backend.BackendException,public void close() throws org.apache.hugegraph.backend.BackendException,public void createSnapshot() ,public java.lang.String graph() ,public void init() ,public boolean initialized() ,public void listen(...
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdb/RocksDBTables.java
RangeIndex
queryByCond
class RangeIndex extends IndexTable { public RangeIndex(String database, String table) { super(database, table); } @Override protected BackendColumnIterator queryByCond(RocksDBSessions.Session session, ConditionQuery query...
assert query.conditionsSize() > 0; List<Condition> conds = query.syspropConditions(HugeKeys.ID); E.checkArgument(!conds.isEmpty(), "Please specify the index conditions"); Id prefix = null; Id min = null; boolean minEq = false; Id max ...
81
469
550
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdbsst/RocksDBSstSessions.java
SstSession
commit
class SstSession extends Session { private final Map<String, Changes> batch; public SstSession() { this.batch = new HashMap<>(); } @Override public void open() { this.opened = true; } @Override public void close() { ...
int count = this.batch.size(); if (count == 0) { return 0; } try { for (Entry<String, Changes> table : this.batch.entrySet()) { if (table.getValue().isEmpty() || table.getKey().endsWith("i")) { ...
1,260
228
1,488
<methods>public void <init>(HugeConfig, java.lang.String, java.lang.String) ,public abstract java.lang.String buildSnapshotPath(java.lang.String) ,public abstract void compactRange() ,public abstract org.apache.hugegraph.backend.store.rocksdb.RocksDBSessions copy(HugeConfig, java.lang.String, java.lang.String) ,public ...
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-server/hugegraph-rocksdb/src/main/java/org/apache/hugegraph/backend/store/rocksdbsst/RocksDBSstStore.java
RocksDBSstStore
openSessionPool
class RocksDBSstStore extends RocksDBStore { public RocksDBSstStore(final BackendStoreProvider provider, final String database, final String store) { super(provider, database, store); } @Override protected RocksDBSessions openSessionPool(HugeConfig config, ...
if (tableNames == null) { return new RocksDBSstSessions(config, this.database(), this.store(), dataPath); } else { return new RocksDBSstSessions(config, this.database(), this.store(), dataPath, tableNames); }
752
76
828
<methods>public void <init>(org.apache.hugegraph.backend.store.BackendStoreProvider, java.lang.String, java.lang.String) ,public void beginTx() ,public synchronized void clear(boolean) ,public void close() ,public void commitTx() ,public Map<java.lang.String,java.lang.String> createSnapshot(java.lang.String) ,public ja...
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-server/hugegraph-scylladb/src/main/java/org/apache/hugegraph/backend/store/scylladb/ScyllaDBMetrics.java
ScyllaDBMetrics
appendExtraMetrics
class ScyllaDBMetrics extends CassandraMetrics { public ScyllaDBMetrics(HugeConfig conf, CassandraSessionPool sessions, String keyspace) { super(conf, sessions, keyspace); } @Override protected void appendExtraMetrics(Map<String, Object> me...
// Table counter Metrics appendCounterMetrics(metrics, probe, this.keyspace(), this.tables(), "EstimatedPartitionCount"); appendCounterMetrics(metrics, probe, this.keyspace(), this.tables(), "DroppedMutations"); appendCounterMetr...
99
423
522
<methods>public void <init>(HugeConfig, org.apache.hugegraph.backend.store.cassandra.CassandraSessionPool, java.lang.String) ,public Map<java.lang.String,java.lang.Object> compact() ,public Map<java.lang.String,java.lang.Object> metrics() <variables>private static final Logger LOG,private final non-sealed Cluster clust...
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-server/hugegraph-scylladb/src/main/java/org/apache/hugegraph/backend/store/scylladb/ScyllaDBStoreProvider.java
ScyllaDBStoreProvider
loadGraphStore
class ScyllaDBStoreProvider extends CassandraStoreProvider { private static final Logger LOG = Log.logger(CassandraStore.class); private static final BackendFeatures FEATURES = new ScyllaDBFeatures(); @Override public String type() { return "scylladb"; } @Override public BackendS...
String name = GRAPH_STORE; LOG.debug("ScyllaDBStoreProvider load GraphStore '{}'", name); if (!this.stores.containsKey(name)) { BackendStore s = new ScyllaDBGraphStore(this, keyspace(), name); this.stores.putIfAbsent(name, s); } BackendStore store = thi...
1,155
161
1,316
<methods>public non-sealed void <init>() ,public java.lang.String driverVersion() ,public java.lang.String type() <variables>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/HgOwnerKey.java
HgOwnerKey
equals
class HgOwnerKey implements Serializable { private final byte[] owner; // TODO: consider remove? since it seems to be useless private int keyCode = 0;// TODO: Be here OK? private byte[] key; // Sequence number, used for batch queries to ensure the order of returned results private int serialNo; ...
if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } HgOwnerKey that = (HgOwnerKey) o; return Arrays.equals(owner, that.owner) && Arrays.equals(key, that.key);
867
89
956
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/HgStoreClient.java
HgStoreClient
setPdClient
class HgStoreClient { // TODO: Holding more than one HgSessionManager is available,if you want to connect multi private final HgSessionProvider sessionProvider; private PDClient pdClient; public HgStoreClient() { this.sessionProvider = new HgStoreSessionProvider(); } public HgStoreCli...
this.pdClient = client; HgStoreNodeManager nodeManager = HgStoreNodeManager.getInstance(); HgStoreNodePartitionerImpl p = new HgStoreNodePartitionerImpl(pdClient, nodeManager); nodeManager.setNodeProvider(p); nodeManager.setNodePartitioner(p); nodeManage...
425
94
519
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/HgNodePartition.java
HgNodePartition
equals
class HgNodePartition { private final Long nodeId; //当前key的hashcode private final Integer keyCode; //分区的开始结束范围 private final Integer startKey; private final Integer endKey; private int hash = -1; HgNodePartition(Long nodeId, Integer keyCode) { this.nodeId = nodeId; thi...
if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } HgNodePartition that = (HgNodePartition) o; return Objects.equals(nodeId, that.nodeId) && Objects.equals(keyCode, that.keyCode);
494
93
587
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/HgNodePartitionerBuilder.java
HgNodePartitionerBuilder
add
class HgNodePartitionerBuilder { private Set<HgNodePartition> partitions = null; static HgNodePartitionerBuilder resetAndGet() { return new HgNodePartitionerBuilder(); } /** * @param nodeId * @param keyCode * @return * @see HgNodePartitionerBuilder:setPartitions(Set<HgNode...
isFalse(nodeId == null, "The argument is invalid: nodeId"); isFalse(keyCode == null, "The argument is invalid: keyCode"); if (this.partitions == null) { this.partitions = new HashSet<>(16, 1); } this.partitions.add(HgNodePartition.of(nodeId, keyCode)); retu...
219
103
322
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/HgStoreNodeManager.java
HgStoreNodeManager
addNode
class HgStoreNodeManager { private final static Set<String> CLUSTER_ID_SET = new HashSet<>(); private final static HgStoreNodeManager instance = new HgStoreNodeManager(); private final String clusterId; private final Map<String, HgStoreNode> addressMap = new ConcurrentHashMap<>(); private final Ma...
HgAssert.isFalse(HgAssert.isInvalid(graphName), "the argument is invalid: graphName"); HgStoreNode node = this.addNode(storeNode); List<HgStoreNode> nodes = null; synchronized (this.graphNodesMap) { nodes = this.graphNodesMap.get(graphName); if (nodes == null) ...
1,800
141
1,941
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/HgStoreNodePartitionerImpl.java
HgStoreNodePartitionerImpl
partition
class HgStoreNodePartitionerImpl implements HgStoreNodePartitioner, HgStoreNodeProvider, HgStoreNodeNotifier { private PDClient pdClient; private HgStoreNodeManager nodeManager; protected HgStoreNodeParti...
try { HashSet<HgNodePartition> partitions = new HashSet<>(); Metapb.Partition partition = null; KVPair<Metapb.Partition, Metapb.Shard> partShard = pdClient.getPartitionById(graphName, partitionId); if (partShard != null) { par...
1,528
211
1,739
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/HgStoreNotice.java
HgStoreNotice
toString
class HgStoreNotice { private final Long nodeId; private final HgNodeStatus nodeStatus; private final String message; private Map<Integer, Long> partitionLeaders; private List<Integer> partitionIds; private HgStoreNotice(Long nodeId, HgNodeStatus nodeStatus, String message) { this.node...
return "HgStoreNotice{" + "nodeId=" + nodeId + ", nodeStatus=" + nodeStatus + ", message='" + message + '\'' + ", partitionLeaders=" + partitionLeaders + ", partitionIds=" + partitionIds + '}';
500
76
576
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/HgTkvEntryImpl.java
HgTkvEntryImpl
equals
class HgTkvEntryImpl implements HgTkvEntry { private final String table; private final byte[] key; private final byte[] value; HgTkvEntryImpl(String table, byte[] key, byte[] value) { this.table = table; this.key = key; this.value = value; } @Override public String...
if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } HgTkvEntryImpl that = (HgTkvEntryImpl) o; return Objects.equals(table, that.table) && Arrays.equals(key, that.key) && Arrays.equals(value...
331
109
440
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/HgTokvEntryImpl.java
HgTokvEntryImpl
equals
class HgTokvEntryImpl implements HgTokvEntry { private final String table; private final HgOwnerKey ownerKey; private final byte[] value; HgTokvEntryImpl(String table, HgOwnerKey ownerKey, byte[] value) { this.table = table; this.ownerKey = ownerKey; this.value = value; } ...
if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } HgTokvEntryImpl that = (HgTokvEntryImpl) o; return Objects.equals(table, that.table) && Objects.equals(ownerKey, that.ownerKey) && Arrays...
321
109
430
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/MultiNodeSessionFactory.java
MultiNodeSessionFactory
buildProxy
class MultiNodeSessionFactory { // TODO multi-instance ? private final static MultiNodeSessionFactory INSTANCE = new MultiNodeSessionFactory(); // TODO multi-instance ? private final HgStoreNodeManager nodeManager = HgStoreNodeManager.getInstance(); // TODO: to be a chain assigned to each graph ...
//return new MultiNodeSessionProxy(graphName, nodeManager, storeNodeDispatcher); //return new NodePartitionSessionProxy(graphName,nodeManager); //return new NodeRetrySessionProxy(graphName,nodeManager); return new NodeTxSessionProxy(graphName, nodeManager);
184
72
256
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/NodeTkv.java
NodeTkv
equals
class NodeTkv { private final HgNodePartition nodePartition; private final String table; private final HgOwnerKey key; private final HgOwnerKey endKey; private HgStoreSession session; NodeTkv(HgNodePartition nodePartition, String table, HgOwnerKey key) { this.nodePartition = nodePartit...
if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } NodeTkv nptKv = (NodeTkv) o; return Objects.equals(nodePartition, nptKv.nodePartition) && Objects.equals(table, nptKv.table) ...
639
138
777
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/SequencedIterator.java
SequencedIterator
next
class SequencedIterator implements HgKvIterator { private static final byte[] EMPTY_BYTES = new byte[0]; private final Queue<HgKvOrderedIterator> queue; private final long limit; private HgKvOrderedIterator<HgKvEntry> iterator; private HgKvEntry entry; private int count; private byte[] posi...
if (this.iterator == null) { hasNext(); } if (this.iterator == null) { throw new NoSuchElementException(); } this.entry = this.iterator.next(); this.position = this.iterator.position(); if (!this.iterator.hasNext()) { this.iter...
703
114
817
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/ShiftWorkIteratorProxy.java
ShiftWorkIteratorProxy
setIterator
class ShiftWorkIteratorProxy implements HgKvIterator { private static final byte[] EMPTY_BYTES = new byte[0]; private final int limit; private HgKvPagingIterator<HgKvEntry> iterator; private Queue<HgKvPagingIterator> queue = new LinkedList<>(); private HgKvEntry entry; private int count; pr...
// if (++this.shiftCount >= this.iterator.getPageSize() / 2) { if (++this.shiftCount >= this.iterator.getPageSize()) { this.iterator = null; this.shiftCount = 0; }
809
69
878
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/TopWorkIteratorProxy.java
TopWorkIteratorProxy
key
class TopWorkIteratorProxy implements HgKvIterator { private static final byte[] EMPTY_BYTES = new byte[0]; private final Queue<HgKvIterator> queue; private final long limit; private HgKvIterator<HgKvEntry> iterator; private HgKvEntry entry; // result count private int count; TopWorkIt...
if (this.entry != null) { return this.entry.key(); } return null;
730
32
762
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/AbstractGrpcClient.java
AbstractGrpcClient
getAsyncStub
class AbstractGrpcClient { private static Map<String, ManagedChannel[]> channels = new ConcurrentHashMap<>(); private static int n = 5; private static int concurrency = 1 << n; private static AtomicLong counter = new AtomicLong(0); private static long limit = Long.MAX_VALUE >> 1; private static...
ManagedChannel[] channels = getChannels(target); HgPair<ManagedChannel, AbstractAsyncStub>[] pairs = asyncStubs.get(target); long l = counter.getAndIncrement(); if (l >= limit) { counter.set(0); } int index = (int) (l & (concurrency - 1)); if (pairs =...
1,114
363
1,477
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/GrpcKvEntryImpl.java
GrpcKvEntryImpl
equals
class GrpcKvEntryImpl implements HgKvEntry { private final byte[] key; private final byte[] value; private final int code; GrpcKvEntryImpl(byte[] k, byte[] v, int code) { this.key = k; this.value = v; this.code = code; } @Override public int code() { return...
if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } GrpcKvEntryImpl hgKvEntry = (GrpcKvEntryImpl) o; return Arrays.equals(key, hgKvEntry.key) && Arrays.equals(value, hgKvEntry.value);
302
105
407
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/GrpcKvIteratorImpl.java
GrpcKvIteratorImpl
of
class GrpcKvIteratorImpl implements HgKvPagingIterator<HgKvEntry>, HgKvOrderedIterator<HgKvEntry> { private final byte[] emptyBytes = HgStoreClientConst.EMPTY_BYTES; private final KvCloseableIterator<Kv> iterator; private final HgPageSize pageLimiter; private final HgStoreNodeSession session; priva...
int pageSize = kvList.size(); return new GrpcKvIteratorImpl(nodeSession, new KvListIterator<Kv>(kvList), () -> pageSize);
1,139
49
1,188
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/GrpcNodeHealthyClient.java
GrpcNodeHealthyClient
isHealthy
class GrpcNodeHealthyClient { private final static Map<String, ManagedChannel> CHANNEL_MAP = new ConcurrentHashMap<>(); private final static Map<String, HealthyGrpc.HealthyBlockingStub> STUB_MAP = new ConcurrentHashMap<>(); // TODO: Forbid constructing out of the package. public GrpcNodeHe...
String target = "localhost:9080"; ManagedChannel channel = ManagedChannelBuilder.forTarget(target).usePlaintext().build(); HealthyGrpc.HealthyBlockingStub stub = HealthyGrpc.newBlockingStub(channel); HealthyOuterClass.StringReply response = stub.isOk(Empty.newBuilder().build()); ...
438
134
572
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/GrpcStoreNodeBuilder.java
GrpcStoreNodeBuilder
setAddress
class GrpcStoreNodeBuilder implements HgStoreNodeBuilder { private static final GrpcStoreSessionClient sessionClient = new GrpcStoreSessionClient(); private static final GrpcStoreStreamClient streamClient = new GrpcStoreStreamClient(); private static final AtomicLong ids = new AtomicLong(0); private fi...
HgAssert.isFalse(HgAssert.isInvalid(address), "The argument is invalid: address."); this.address = address; return this;
437
42
479
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/GrpcStoreNodeImpl.java
GrpcStoreNodeImpl
equals
class GrpcStoreNodeImpl implements HgStoreNode { private final GrpcStoreSessionClient sessionClient; private final GrpcStoreStreamClient streamClient; private final HgStoreNodeManager nodeManager; private String address; private Long nodeId; GrpcStoreNodeImpl(HgStoreNodeManager nodeManager, Gr...
if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } GrpcStoreNodeImpl that = (GrpcStoreNodeImpl) o; return Objects.equals(address, that.address) && Objects.equals(nodeId, that.nodeId);
482
93
575
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/GrpcStoreSessionClient.java
GrpcStoreSessionClient
doGet
class GrpcStoreSessionClient extends AbstractGrpcClient { @Override public HgStoreSessionBlockingStub getBlockingStub(ManagedChannel channel) { HgStoreSessionBlockingStub stub; stub = HgStoreSessionGrpc.newBlockingStub(channel); return stub; } private HgStoreSessionBlockingStub...
if (log.isDebugEnabled()) { log.debug("doGet: {}-{}-{}-{}", nodeSession, table, ownerKey, GetReq.newBuilder() .setHeader( GrpcUtil....
913
176
1,089
<methods>public void <init>() ,public AbstractAsyncStub getAsyncStub(ManagedChannel) ,public AbstractAsyncStub getAsyncStub(java.lang.String) ,public abstract AbstractBlockingStub getBlockingStub(ManagedChannel) ,public AbstractBlockingStub getBlockingStub(java.lang.String) ,public ManagedChannel[] getChannels(java.lan...
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/GrpcStoreStateClient.java
GrpcStoreStateClient
getScanState
class GrpcStoreStateClient extends AbstractGrpcClient { private final PDConfig pdConfig; private final PDClient pdClient; public GrpcStoreStateClient(PDConfig pdConfig) { this.pdConfig = pdConfig; pdClient = PDClient.create(this.pdConfig); } public Set<ScanState> getScanState() th...
try { List<Metapb.Store> activeStores = pdClient.getActiveStores(); Set<ScanState> states = activeStores.parallelStream().map(node -> { String address = node.getAddress(); HgStoreStateBlockingStub stub = (HgStoreStateBlockingStub) getBlockingStub(address)...
178
159
337
<methods>public void <init>() ,public AbstractAsyncStub getAsyncStub(ManagedChannel) ,public AbstractAsyncStub getAsyncStub(java.lang.String) ,public abstract AbstractBlockingStub getBlockingStub(ManagedChannel) ,public AbstractBlockingStub getBlockingStub(java.lang.String) ,public ManagedChannel[] getChannels(java.lan...
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/GrpcStoreStreamClient.java
GrpcStoreStreamClient
doScan
class GrpcStoreStreamClient extends AbstractGrpcClient { public HgStoreStreamStub getStub(HgStoreNodeSession nodeSession) { return (HgStoreStreamStub) getAsyncStub(nodeSession.getStoreNode().getAddress()); } @Override public AbstractAsyncStub getAsyncStub(ManagedChannel channel) { retu...
return KvPageScanner.scanAll(nodeSession , this.getStub(nodeSession) , table , limit , query );
1,403
45
1,448
<methods>public void <init>() ,public AbstractAsyncStub getAsyncStub(ManagedChannel) ,public AbstractAsyncStub getAsyncStub(java.lang.String) ,public abstract AbstractBlockingStub getBlockingStub(ManagedChannel) ,public AbstractBlockingStub getBlockingStub(java.lang.String) ,public ManagedChannel[] getChannels(java.lan...
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/GrpcUtil.java
GrpcUtil
getOwnerKeyBuilder
class GrpcUtil { private static final ThreadLocal<Key.Builder> keyBuilder = new ThreadLocal<Key.Builder>(); static Header getHeader(HgStoreNodeSession nodeSession) { return Header.newBuilder() .setGraph(nodeSession.getGraphName()) .build(); } static T...
Key.Builder builder = keyBuilder.get(); if (builder == null) { builder = Key.newBuilder(); // TODO 线程级变量,寻找删除时机 keyBuilder.set(builder); } return builder;
911
66
977
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/KvBatchOneShotScanner.java
KvBatchOneShotScanner
next
class KvBatchOneShotScanner implements KvCloseableIterator<Kv>, HgPageSize, HgSeekAble { private final HgStoreNodeSession nodeSession; private final HgStoreStreamGrpc.HgStoreStreamBlockingStub stub; private final HgScanQuery scanQuery; private Iterator<Kv> iterator; private List<Kv> list = null; ...
if (this.iterator == null) { this.iterator = this.createIterator(); } return this.iterator.next();
609
37
646
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/KvBatchScanner.java
TaskSplitter
evaluateMaxTaskSize
class TaskSplitter { final HgScanQuery scanQuery; final BiFunction<HgScanQuery, KvCloseableIterator, Boolean> taskHandler; private KvBatchScannerMerger notifier; private Iterator<HgOwnerKey> prefixItr; private int maxTaskSize = 0; // 最大并行任务数 private int maxBatchSize = Pr...
if (maxTaskSize == 0) { // 根据第一批次任务,得到store数量,然后计算最大任务数 if (scanQuery.getOrderType() == ScanOrderType.ORDER_STRICT) { maxTaskSize = 1; // 点排序,每台机器一个流, 所有store流结束后才能启动其他流 } else { maxTaskSize = this.notifier.getScannerCount() * maxTaskS...
780
211
991
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/KvBatchScanner5.java
OrderConsumer
hasNext
class OrderConsumer implements KvCloseableIterator<Kv>, HgPageSize { private final OrderBroker broker; private final String consumerId; private Iterator<Kv> dataIterator; private long tookCount = 0; OrderConsumer(OrderBroker broker) { this.broker = broker; ...
if (this.dataIterator == null) { this.dataIterator = this.getIterator(); } else { if (this.dataIterator.hasNext()) { return true; } else { this.dataIterator = this.getIterator(); } ...
441
223
664
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/KvBatchUtil.java
KvBatchUtil
addRangeCondition
class KvBatchUtil { static final byte[] EMPTY_POSITION = HgStoreClientConst.EMPTY_BYTES; static ScanStreamBatchReq.Builder getRequestBuilder(HgStoreNodeSession nodeSession) { return ScanStreamBatchReq.newBuilder().setHeader(getHeader(nodeSession)); } static ScanQueryRequest createQueryReq(HgS...
List<HgOwnerKey> startList = scanQuery.getStartList(); List<HgOwnerKey> endList = scanQuery.getEndList(); if (startList == null || startList.isEmpty()) { throw new RuntimeException( "The start-list of ScanQuery shouldn't to be invalid in ScanMethod.RANGE mode" +...
855
317
1,172
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/KvOneShotScanner.java
KvOneShotScanner
next
class KvOneShotScanner implements KvCloseableIterator<Kv>, HgPageSize, HgSeekAble { private static final HgStoreClientConfig storeClientConfig = HgStoreClientConfig.of(); private final HgStoreNodeSession session; private final HgStoreStreamBlockingStub stub; private final ScanStreamReq.Builder reqBuild...
if (this.iterator == null) { this.init(); } return this.iterator.next();
1,692
32
1,724
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/NotifyingExecutor.java
NotifyingExecutor
notifyErrConsumer
class NotifyingExecutor { private final String graphName; private final HgStoreNodeManager nodeManager; private final HgStoreNodeSession nodeSession; private Map<PartitionFaultType, Consumer<PartitionFaultResponse>> partitionFaultHandlers; NotifyingExecutor(String graphName, HgStoreNodeManager no...
return t -> { nodeManager.notifying( this.graphName, HgStoreNotice.of(this.nodeSession.getStoreNode().getNodeId(), status, t.getMessage()) ); };
1,733
61
1,794
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/SeekAbleIterator.java
SeekAbleIterator
of
class SeekAbleIterator<E> implements Iterator, HgSeekAble { private final Iterator<E> iterator; private final Consumer<byte[]> seeker; private final Supplier<byte[]> positioner; private SeekAbleIterator(Iterator<E> iterator, Supplier<byte[]> positioner, Consumer<byte[]> se...
HgAssert.isArgumentNotNull(iterator, "iterator"); HgAssert.isArgumentNotNull(positioner, "positioner"); HgAssert.isArgumentNotNull(seeker, "seeker"); return new SeekAbleIterator(iterator, positioner, seeker);
293
70
363
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/grpc/SwitchingExecutor.java
SwitchingExecutor
invoke
class SwitchingExecutor { private SwitchingExecutor() { } static SwitchingExecutor of() { return new SwitchingExecutor(); } <T> Optional<T> invoke(Supplier<Boolean> switcher, Supplier<T> trueSupplier, Supplier<T> falseSupplier) {<FILL_FUNCTION_BODY>} }
Optional<T> option = null; if (switcher.get()) { option = Optional.of(trueSupplier.get()); } else { option = Optional.of(falseSupplier.get()); } if (option == null) { option = Optional.empty(); } return option;
93
86
179
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/util/Base58.java
Base58
divmod58
class Base58 { public static final char[] ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz".toCharArray(); private static final int[] INDEXES = new int[128]; static { for (int i = 0; i < INDEXES.length; i++) { INDEXES[i] = -1; } for (in...
int remainder = 0; for (int i = startAt; i < number.length; i++) { int digit256 = (int) number[i] & 0xFF; int temp = remainder * 256 + digit256; number[i] = (byte) (temp / 58); remainder = temp % 58; } return (byte) remainder;
1,275
109
1,384
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/util/ExecutorPool.java
ExecutorPool
createExecutor
class ExecutorPool { public static ThreadFactory newThreadFactory(String namePrefix) { HgAssert.isArgumentNotNull(namePrefix, "namePrefix"); return new DefaultThreadFactory(namePrefix); } public static ThreadPoolExecutor createExecutor(String name, long keepAliveTime, ...
return new ThreadPoolExecutor(coreThreads, maxThreads, keepAliveTime, TimeUnit.SECONDS, new SynchronousQueue<>(), newThreadFactory(name), new ThreadPoolExecutor.CallerRunsPolicy() );
253
63
316
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/util/HgAssert.java
HgAssert
isTrue
class HgAssert { public static void isTrue(boolean expression, String message) {<FILL_FUNCTION_BODY>} public static void isTrue(boolean expression, Supplier<String> msg) { if (msg == null) { throw new IllegalArgumentException("message supplier is null"); } if (!expression) ...
if (message == null) { throw new IllegalArgumentException("message is null"); } if (!expression) { throw new IllegalArgumentException(message); }
828
45
873
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/util/HgBufferProxy.java
HgBufferProxy
receive
class HgBufferProxy<T> { private final BlockingQueue<Supplier<T>> queue; private final AtomicBoolean closed = new AtomicBoolean(false); private final ReentrantLock lock = new ReentrantLock(); private final Runnable task; private Throwable err; private HgBufferProxy(Runnable task) { thi...
Supplier<T> s; if (this.closed.get()) { s = this.queue.poll(); this.checkErr(); return s != null ? s.get() : null; } if (this.queue.size() <= 1) { this.apply(); } lock.lock(); try { if (this.isClosed()) ...
587
331
918
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/util/HgStoreClientConfig.java
HgStoreClientConfig
overrideViaProperties
class HgStoreClientConfig { private static final int GRPC_DEFAULT_TIMEOUT_SECONDS = 100; private static final int GRPC_DEFAULT_MAX_INBOUND_MESSAGE_SIZE = 1024 * 1024 * 1024; private static final int GRPC_DEFAULT_MAX_OUTBOUND_MESSAGE_SIZE = 1024 * 1024 * 1024; private static final int NET_KV_SCANNER_PA...
try { prb = (PropertyResourceBundle) PropertyResourceBundle.getBundle(fileName); } catch (Throwable t) { log.warn("Failed to load " + fileName + ".properties."); log.info("Default configuration was activated."); return; } PropertiesWrapper...
1,250
343
1,593
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/util/HgStoreClientUtil.java
HgStoreClientUtil
toStr
class HgStoreClientUtil { public static HgOwnerKey toOwnerKey(byte[] key) { return new HgOwnerKey(HgStoreClientConst.EMPTY_BYTES, key); } public static HgOwnerKey toOwnerKey(String key) { return new HgOwnerKey(HgStoreClientConst.EMPTY_BYTES, toBytes(key)); } public static HgOwnerK...
if (ownerKey == null) { return ""; } return "{ " + "owner: " + Arrays.toString(ownerKey.getOwner()) + ", key: " + toStr(ownerKey.getKey()) + " }";
1,143
68
1,211
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/util/HgUuid.java
HgUuid
encode
class HgUuid { private static String encode(UUID uuid) {<FILL_FUNCTION_BODY>} /** * Get a UUID in Base58 FORM * * @return */ public static String newUUID() { return encode(UUID.randomUUID()); } }
ByteBuffer bb = ByteBuffer.wrap(new byte[16]); bb.putLong(uuid.getMostSignificantBits()); bb.putLong(uuid.getLeastSignificantBits()); return Base58.encode(bb.array());
84
69
153
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/util/MetricX.java
MetricX
plusIteratorWait
class MetricX { // Total working time consumed by Iterators public static AtomicLong iteratorSum = new AtomicLong(); // Num of Iterators public static AtomicLong iteratorCount = new AtomicLong(); // Max working time consumed by Iterators public static AtomicLong iteratorMax = new AtomicLong(); ...
iteratorSum.addAndGet(nanoSeconds); iteratorCount.getAndIncrement(); if (iteratorMax.get() < nanoSeconds) { iteratorMax.set(nanoSeconds); }
542
62
604
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-client/src/main/java/org/apache/hugegraph/store/client/util/PropertyUtil.java
PropertyUtil
getInt
class PropertyUtil { private static final Logger LOG = LoggerFactory.getLogger(PropertyUtil.class); public static String get(String key) { return get(key, null); } public static String get(final String key, String def) { if (key == null) { throw new NullPointerException("k...
String value = get(key); if (value == null) { return def; } value = value.trim().toLowerCase(); try { return Integer.parseInt(value); } catch (Exception e) { LOG.warn("exception ", e); } return def;
449
83
532
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-common/src/main/java/org/apache/hugegraph/store/buffer/ByteBufferAllocator.java
ByteBufferAllocator
get
class ByteBufferAllocator { // size of each Buffer final int capacity; // max num of Buffers final int maxCount; final BlockingQueue<ByteBuffer> freeQueue = new LinkedBlockingQueue<>(); // current num of Buffers in queue AtomicInteger totalCount; public ByteBufferAllocator(int cap, int...
ByteBuffer buffer = null; while (buffer == null) { if (freeQueue.size() > 0) { buffer = freeQueue.poll(); } else if (totalCount.get() < maxCount) { buffer = ByteBuffer.allocate(capacity); totalCount.incrementAndGet(); }...
200
117
317
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-common/src/main/java/org/apache/hugegraph/store/buffer/KVByteBuffer.java
KVByteBuffer
getBytes
class KVByteBuffer { ByteBuffer buffer; public KVByteBuffer(int capacity) { buffer = ByteBuffer.allocate(capacity); } public KVByteBuffer(byte[] buffer) { this.buffer = ByteBuffer.wrap(buffer); } public KVByteBuffer(ByteBuffer buffer) { this.buffer = buffer; } ...
int len = buffer.getInt(); byte[] data = new byte[len]; buffer.get(data); return data;
442
37
479
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-common/src/main/java/org/apache/hugegraph/store/term/Bits.java
Bits
getInt
class Bits { /** * 大头字节序写入short */ public static void putShort(byte[] buf, int offSet, int x) { buf[offSet] = (byte) (x >> 8); buf[offSet + 1] = (byte) (x); } public static void putInt(byte[] buf, int offSet, int x) { buf[offSet] = (byte) (x >> 24); buf[offSet...
int x = (buf[offSet] << 24) + ((buf[offSet + 1] & 0xff) << 16) + ((buf[offSet + 2] & 0xff) << 8) + (buf[offSet + 3] & 0xff); return x;
402
81
483
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-common/src/main/java/org/apache/hugegraph/store/term/HgPair.java
HgPair
hashCode
class HgPair<K, V> implements Serializable { /** * Key of this <code>Pair</code>. */ private K key; /** * Value of this <code>Pair</code>. */ private V value; public HgPair() { } /** * Creates a new pair * * @param key The key for this pair * @pa...
// name's hashCode is multiplied by an arbitrary prime number (13) // in order to make sure there is a difference in the hashCode between // these two parameters: // name: a value: aa // name: aa value: a return key.hashCode() * 13 + (value == null ? 0 : value.hashCod...
871
96
967
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-common/src/main/java/org/apache/hugegraph/store/term/HgTriple.java
HgTriple
hashCode
class HgTriple<X, Y, Z> { private final X x; private final Y y; private final Z z; private int hash = -1; public HgTriple(X x, Y y, Z z) { this.x = x; this.y = y; this.z = z; } public X getX() { return x; } public Y getY() { return y; }...
if (hash == -1) { hash = Objects.hash(x, y, z); } return this.hash;
369
38
407
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-grpc/src/main/java/org/apache/hugegraph/store/grpc/GraphStoreGrpc.java
MethodHandlers
invoke
class MethodHandlers<Req, Resp> implements io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>, io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>, io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> { private final GraphStore...
switch (methodId) { case METHODID_SCAN_PARTITION: return (io.grpc.stub.StreamObserver<Req>) serviceImpl.scanPartition( (io.grpc.stub.StreamObserver<org.apache.hugegraph.store.grpc.Graphpb.ScanResponse>) responseObserver); default: throw new AssertionError(); ...
336
101
437
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-grpc/src/main/java/org/apache/hugegraph/store/grpc/session/BatchCommitReq.java
Builder
mergeFrom
class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:BatchCommitReq) org.apache.hugegraph.store.grpc.session.BatchCommitReqOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescri...
if (other == org.apache.hugegraph.store.grpc.session.BatchCommitReq.getDefaultInstance()) return this; this.mergeUnknownFields(other.unknownFields); onChanged(); return this;
1,577
60
1,637
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-grpc/src/main/java/org/apache/hugegraph/store/grpc/session/BatchRollbackReq.java
Builder
mergeFrom
class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:BatchRollbackReq) org.apache.hugegraph.store.grpc.session.BatchRollbackReqOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDe...
org.apache.hugegraph.store.grpc.session.BatchRollbackReq parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.apache.hugegraph.store.grpc.session.BatchRollba...
1,507
152
1,659
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-grpc/src/main/java/org/apache/hugegraph/store/grpc/stream/ScanPauseRequest.java
Builder
build
class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:ScanPauseRequest) org.apache.hugegraph.store.grpc.stream.ScanPauseRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDes...
org.apache.hugegraph.store.grpc.stream.ScanPauseRequest result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result;
1,557
61
1,618
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-grpc/src/main/java/org/apache/hugegraph/store/grpc/stream/ScanReceiptRequest.java
Builder
mergeFrom
class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:ScanReceiptRequest) org.apache.hugegraph.store.grpc.stream.ScanReceiptRequestOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor ge...
org.apache.hugegraph.store.grpc.stream.ScanReceiptRequest parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (org.apache.hugegraph.store.grpc.stream.ScanReceipt...
1,739
150
1,889
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-rocksdb/src/main/java/org/apache/hugegraph/rocksdb/access/DBStoreException.java
DBStoreException
rootCause
class DBStoreException extends RuntimeException { private static final long serialVersionUID = 5956983547131986887L; public DBStoreException(String message) { super(message); } public DBStoreException(String message, Throwable cause) { super(message, cause); } public DBStoreE...
Throwable cause = e; while (cause.getCause() != null) { cause = cause.getCause(); } return cause;
304
45
349
<methods>public void <init>() ,public void <init>(java.lang.String) ,public void <init>(java.lang.Throwable) ,public void <init>(java.lang.String, java.lang.Throwable) <variables>static final long serialVersionUID
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-rocksdb/src/main/java/org/apache/hugegraph/rocksdb/access/RocksDBScanIterator.java
RocksDBScanIterator
checkArguments
class RocksDBScanIterator<T> implements ScanIterator { private static final byte[] EMPTY_VALUE = new byte[0]; private final RocksIterator rawIt; private final byte[] keyBegin; private final byte[] keyEnd; private final int scanType; private final AtomicBoolean closed = new AtomicBoolean(false)...
E.checkArgument(!(this.match(ScanIterator.Trait.SCAN_PREFIX_BEGIN) && this.match(ScanIterator.Trait.SCAN_PREFIX_END)), "Can't set SCAN_PREFIX_WITH_BEGIN and " + "SCAN_PREFIX_WITH_END at the same time"); E.checkArgument(!(this.ma...
1,358
600
1,958
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-rocksdb/src/main/java/org/apache/hugegraph/rocksdb/access/util/Asserts.java
Asserts
isTrue
class Asserts { public static void isTrue(boolean expression, String message) { if (message == null) { throw new IllegalArgumentException("message is null"); } if (!expression) { throw new IllegalArgumentException(message); } } public static void isT...
if (s == null) { throw new IllegalArgumentException("Supplier<RuntimeException> is null"); } if (!expression) { throw s.get(); }
102
48
150
<no_super_class>
apache_incubator-hugegraph
incubator-hugegraph/hugegraph-store/hg-store-rocksdb/src/main/java/org/apache/hugegraph/rocksdb/access/util/ZipUtils.java
ZipUtils
compressDirectoryToZipFile
class ZipUtils { public static void compress(final String rootDir, final String sourceDir, final String outputFile, final Checksum checksum) throws IOException { try (final FileOutputStream fos...
final String dir = Paths.get(rootDir, sourceDir).toString(); final File[] files = new File(dir).listFiles(); for (final File file : files) { final String child = Paths.get(sourceDir, file.getName()).toString(); if (file.isDirectory()) { compressDirectoryT...
534
169
703
<no_super_class>
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-drl/src/main/java/org/optaplanner/constraint/drl/DrlScoreDirectorFactory.java
DrlScoreDirectorFactory
assertGlobalScoreHolderExists
class DrlScoreDirectorFactory<Solution_, Score_ extends Score<Score_>> extends AbstractScoreDirectorFactory<Solution_, Score_> { private final KieBase kieBase; protected Map<Rule, Function<Solution_, Score_>> ruleToConstraintWeightExtractorMap; /** * @param solutionDescriptor never null ...
boolean hasGlobalScoreHolder = false; for (KiePackage kiePackage : kieBase.getKiePackages()) { for (Global global : kiePackage.getGlobalVariables()) { if (DrlScoreDirector.GLOBAL_SCORE_HOLDER_KEY.equals(global.getName())) { hasGlobalScoreHolder = true; ...
940
314
1,254
<methods>public void <init>(SolutionDescriptor<Solution_>) ,public void assertScoreFromScratch(Solution_) ,public InnerScoreDirector<Solution_,Score_> buildScoreDirector() ,public InnerScoreDirectorFactory<Solution_,Score_> getAssertionScoreDirectorFactory() ,public org.optaplanner.core.impl.score.trend.InitializingSco...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-drl/src/main/java/org/optaplanner/constraint/drl/DrlScoreDirectorFactoryService.java
DrlScoreDirectorFactoryService
buildScoreDirectorFactory
class DrlScoreDirectorFactoryService<Solution_, Score_ extends Score<Score_>> implements ScoreDirectorFactoryService<Solution_, Score_> { private static final Logger LOGGER = LoggerFactory.getLogger(DrlScoreDirectorFactoryService.class); private static final AtomicBoolean DRL_DEPRECATION_MESSAGE_SHOWN ...
KieBase kieBase; if (config.getGizmoKieBaseSupplier() != null) { kieBase = ((Supplier<KieBase>) config.getGizmoKieBaseSupplier()).get(); } else { KieHelper kieHelper = new KieHelper(PropertySpecificOption.ALLOWED) .setClassLoader(classLoader); ...
830
445
1,275
<no_super_class>
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-drl/src/main/java/org/optaplanner/constraint/drl/holder/HardMediumSoftLongScoreHolderImpl.java
HardMediumSoftLongScoreHolderImpl
impactScore
class HardMediumSoftLongScoreHolderImpl extends AbstractScoreHolder<HardMediumSoftLongScore> implements HardMediumSoftLongScoreHolder { protected final Map<Rule, LongMatchExecutor> matchExecutorByNumberMap = new LinkedHashMap<>(); /** Slower than {@link #matchExecutorByNumberMap} */ protected final...
Rule rule = kcontext.getRule(); ScoreMatchExecutor<HardMediumSoftLongScore> matchExecutor = matchExecutorByScoreMap.get(rule); if (matchExecutor == null) { throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName() + ") does n...
1,816
165
1,981
<methods>public static ScoreHolder_ buildScoreHolder(ScoreDefinition<Score_>, boolean) ,public void configureConstraintWeight(Rule, org.optaplanner.core.api.score.buildin.hardmediumsoftlong.HardMediumSoftLongScore) ,public abstract org.optaplanner.core.api.score.buildin.hardmediumsoftlong.HardMediumSoftLongScore extrac...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-drl/src/main/java/org/optaplanner/constraint/drl/holder/HardSoftLongScoreHolderImpl.java
HardSoftLongScoreHolderImpl
addMultiConstraintMatch
class HardSoftLongScoreHolderImpl extends AbstractScoreHolder<HardSoftLongScore> implements HardSoftLongScoreHolder { protected final Map<Rule, LongMatchExecutor> matchExecutorByNumberMap = new LinkedHashMap<>(); /** Slower than {@link #matchExecutorByNumberMap} */ protected final Map<Rule, ScoreMa...
hardScore += hardWeight; softScore += softWeight; registerConstraintMatch(kcontext, () -> { hardScore -= hardWeight; softScore -= softWeight; }, () -> HardSoftLongScore.of(hardWeight, softWeight));
1,594
73
1,667
<methods>public static ScoreHolder_ buildScoreHolder(ScoreDefinition<Score_>, boolean) ,public void configureConstraintWeight(Rule, org.optaplanner.core.api.score.buildin.hardsoftlong.HardSoftLongScore) ,public abstract org.optaplanner.core.api.score.buildin.hardsoftlong.HardSoftLongScore extractScore(int) ,public Map<...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-drl/src/main/java/org/optaplanner/constraint/drl/holder/HardSoftScoreHolderImpl.java
HardSoftScoreHolderImpl
configureConstraintWeight
class HardSoftScoreHolderImpl extends AbstractScoreHolder<HardSoftScore> implements HardSoftScoreHolder { protected final Map<Rule, IntMatchExecutor> matchExecutorByNumberMap = new LinkedHashMap<>(); /** Slower than {@link #matchExecutorByNumberMap} */ protected final Map<Rule, ScoreMatchExecutor<HardSoftS...
super.configureConstraintWeight(rule, constraintWeight); IntMatchExecutor matchExecutor; if (constraintWeight.isZero()) { matchExecutor = (RuleContext kcontext, int matchWeight) -> { }; } else if (constraintWeight.softScore() == 0) { matchExecutor = ...
1,404
310
1,714
<methods>public static ScoreHolder_ buildScoreHolder(ScoreDefinition<Score_>, boolean) ,public void configureConstraintWeight(Rule, org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore) ,public abstract org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore extractScore(int) ,public Map<java.lang.String...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-drl/src/main/java/org/optaplanner/constraint/drl/holder/SimpleBigDecimalScoreHolderImpl.java
SimpleBigDecimalScoreHolderImpl
impactScore
class SimpleBigDecimalScoreHolderImpl extends AbstractScoreHolder<SimpleBigDecimalScore> implements SimpleBigDecimalScoreHolder { protected final Map<Rule, BigDecimalMatchExecutor> matchExecutorByNumberMap = new LinkedHashMap<>(); protected BigDecimal score = BigDecimal.ZERO; public SimpleBigDeci...
Rule rule = kcontext.getRule(); BigDecimalMatchExecutor matchExecutor = matchExecutorByNumberMap.get(rule); if (matchExecutor == null) { throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName() + ") does not match a @" + Con...
781
134
915
<methods>public static ScoreHolder_ buildScoreHolder(ScoreDefinition<Score_>, boolean) ,public void configureConstraintWeight(Rule, org.optaplanner.core.api.score.buildin.simplebigdecimal.SimpleBigDecimalScore) ,public abstract org.optaplanner.core.api.score.buildin.simplebigdecimal.SimpleBigDecimalScore extractScore(i...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-drl/src/main/java/org/optaplanner/constraint/drl/holder/SimpleLongScoreHolderImpl.java
SimpleLongScoreHolderImpl
impactScore
class SimpleLongScoreHolderImpl extends AbstractScoreHolder<SimpleLongScore> implements SimpleLongScoreHolder { protected final Map<Rule, LongMatchExecutor> matchExecutorByNumberMap = new LinkedHashMap<>(); protected long score; public SimpleLongScoreHolderImpl(boolean constraintMatchEnabled) { ...
throw new UnsupportedOperationException("In the rule (" + kcontext.getRule().getName() + "), the scoreHolder class (" + getClass() + ") does not support a BigDecimal weightMultiplier (" + weightMultiplier + ").\n" + "If you're using constraint streams, maybe swit...
823
93
916
<methods>public static ScoreHolder_ buildScoreHolder(ScoreDefinition<Score_>, boolean) ,public void configureConstraintWeight(Rule, org.optaplanner.core.api.score.buildin.simplelong.SimpleLongScore) ,public abstract org.optaplanner.core.api.score.buildin.simplelong.SimpleLongScore extractScore(int) ,public Map<java.lan...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-drl/src/main/java/org/optaplanner/constraint/drl/holder/SimpleScoreHolderImpl.java
SimpleScoreHolderImpl
impactScore
class SimpleScoreHolderImpl extends AbstractScoreHolder<SimpleScore> implements SimpleScoreHolder { protected final Map<Rule, IntMatchExecutor> matchExecutorByNumberMap = new LinkedHashMap<>(); protected int score; public SimpleScoreHolderImpl(boolean constraintMatchEnabled) { super(constraintMat...
Rule rule = kcontext.getRule(); IntMatchExecutor matchExecutor = matchExecutorByNumberMap.get(rule); if (matchExecutor == null) { throw new IllegalStateException("The DRL rule (" + rule.getPackageName() + ":" + rule.getName() + ") does not match a @" + Constraint...
835
132
967
<methods>public static ScoreHolder_ buildScoreHolder(ScoreDefinition<Score_>, boolean) ,public void configureConstraintWeight(Rule, org.optaplanner.core.api.score.buildin.simple.SimpleScore) ,public abstract org.optaplanner.core.api.score.buildin.simple.SimpleScore extractScore(int) ,public Map<java.lang.String,Constra...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/BavetConstraintFactory.java
BavetConstraintFactory
share
class BavetConstraintFactory<Solution_> extends InnerConstraintFactory<Solution_, BavetConstraint<Solution_>> { private final SolutionDescriptor<Solution_> solutionDescriptor; private final EnvironmentMode environmentMode; private final String defaultConstraintPackage; private final Map<BavetA...
return (Stream_) sharingStreamMap.computeIfAbsent(stream, k -> { consumer.accept(stream); return stream; });
795
40
835
<methods>public non-sealed void <init>() ,public void assertValidFromType(Class<A>) ,public List<BavetConstraint<Solution_>> buildConstraints(org.optaplanner.core.api.score.stream.ConstraintProvider) ,public UniConstraintStream<A> forEach(Class<A>) ,public transient BiConstraintStream<A,A> forEachUniquePair(Class<A>, B...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/BavetConstraintSession.java
BavetConstraintSession
calculateScore
class BavetConstraintSession<Score_ extends Score<Score_>> { private final AbstractScoreInliner<Score_> scoreInliner; private final Map<Class<?>, ForEachUniNode<Object>> declaredClassToNodeMap; private final AbstractNode[] nodes; // Indexed by nodeIndex private final Map<Class<?>, ForEachUniNode<Object...
for (AbstractNode node : nodes) { node.calculateScore(); } return scoreInliner.extractScore(initScore);
732
40
772
<no_super_class>
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/BavetConstraintSessionFactory.java
BavetConstraintSessionFactory
buildSession
class BavetConstraintSessionFactory<Solution_, Score_ extends Score<Score_>> { private final SolutionDescriptor<Solution_> solutionDescriptor; private final List<BavetConstraint<Solution_>> constraintList; public BavetConstraintSessionFactory(SolutionDescriptor<Solution_> solutionDescriptor, L...
ScoreDefinition<Score_> scoreDefinition = solutionDescriptor.getScoreDefinition(); AbstractScoreInliner<Score_> scoreInliner = AbstractScoreInliner.buildScoreInliner(scoreDefinition, constraintMatchEnabled); Score_ zeroScore = scoreDefinition.getZeroScore(); Set<BavetAb...
186
704
890
<no_super_class>
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/BavetConstraintStreamScoreDirector.java
BavetConstraintStreamScoreDirector
getIndictmentMap
class BavetConstraintStreamScoreDirector<Solution_, Score_ extends Score<Score_>> extends AbstractScoreDirector<Solution_, Score_, BavetConstraintStreamScoreDirectorFactory<Solution_, Score_>> { protected BavetConstraintSession<Score_> session; public BavetConstraintStreamScoreDirector( Ba...
if (workingSolution == null) { throw new IllegalStateException( "The method setWorkingSolution() must be called before the method getIndictmentMap()."); } return session.getIndictmentMap();
1,282
60
1,342
<methods>public final void afterEntityAdded(java.lang.Object) ,public void afterEntityAdded(EntityDescriptor<Solution_>, java.lang.Object) ,public final void afterEntityRemoved(java.lang.Object) ,public void afterEntityRemoved(EntityDescriptor<Solution_>, java.lang.Object) ,public void afterListVariableChanged(java.lan...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/BavetConstraintStreamScoreDirectorFactory.java
BavetConstraintStreamScoreDirectorFactory
fireAndForget
class BavetConstraintStreamScoreDirectorFactory<Solution_, Score_ extends Score<Score_>> extends AbstractConstraintStreamScoreDirectorFactory<Solution_, Score_> { private final BavetConstraintSessionFactory<Solution_, Score_> constraintSessionFactory; private final List<BavetConstraint<Solution_>> cons...
BavetConstraintSession<Score_> session = newSession(true, null); Arrays.stream(facts).forEach(session::insert); session.calculateScore(0); return session.getScoreInliner();
432
60
492
<methods>public transient abstract AbstractScoreInliner<Score_> fireAndForget(java.lang.Object[]) ,public abstract org.optaplanner.core.api.score.stream.Constraint[] getConstraints() <variables>
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/bi/BavetFilterBiConstraintStream.java
BavetFilterBiConstraintStream
buildNode
class BavetFilterBiConstraintStream<Solution_, A, B> extends BavetAbstractBiConstraintStream<Solution_, A, B> { private final BavetAbstractBiConstraintStream<Solution_, A, B> parent; private final BiPredicate<A, B> predicate; public BavetFilterBiConstraintStream(BavetConstraintFactory<Solution_> constrain...
buildHelper.<BiTuple<A, B>> putInsertUpdateRetract(this, childStreamList, tupleLifecycle -> new ConditionalBiTupleLifecycle<>(predicate, tupleLifecycle));
609
59
668
<methods>public void <init>(BavetConstraintFactory<Solution_>, org.optaplanner.constraint.streams.common.RetrievalSemantics) ,public BavetAbstractBiConstraintStream<Solution_,A,B> filter(BiPredicate<A,B>) ,public BiConstraintStream<A,ResultB_> flattenLast(Function<B,Iterable<ResultB_>>) ,public List<BavetAbstractBiCons...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/bi/BavetFlattenLastBridgeBiConstraintStream.java
BavetFlattenLastBridgeBiConstraintStream
buildNode
class BavetFlattenLastBridgeBiConstraintStream<Solution_, A, B, NewB> extends BavetAbstractBiConstraintStream<Solution_, A, B> { private final BavetAbstractBiConstraintStream<Solution_, A, B> parent; private final Function<B, Iterable<NewB>> mappingFunction; private BavetFlattenLastBiConstraintStre...
if (!childStreamList.isEmpty()) { throw new IllegalStateException("Impossible state: the stream (" + this + ") has an non-empty childStreamList (" + childStreamList + ") but it's a flattenLast bridge."); } int inputStoreIndex = buildHelper.reserveTupleStoreIndex(...
505
204
709
<methods>public void <init>(BavetConstraintFactory<Solution_>, org.optaplanner.constraint.streams.common.RetrievalSemantics) ,public BavetAbstractBiConstraintStream<Solution_,A,B> filter(BiPredicate<A,B>) ,public BiConstraintStream<A,ResultB_> flattenLast(Function<B,Iterable<ResultB_>>) ,public List<BavetAbstractBiCons...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/bi/BavetGroupBiConstraintStream.java
BavetGroupBiConstraintStream
toString
class BavetGroupBiConstraintStream<Solution_, A, B> extends BavetAbstractBiConstraintStream<Solution_, A, B> { private final BavetAbstractConstraintStream<Solution_> parent; public BavetGroupBiConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, BavetAbstractConstraintStre...
return "Group() with " + childStreamList.size() + " children";
360
22
382
<methods>public void <init>(BavetConstraintFactory<Solution_>, org.optaplanner.constraint.streams.common.RetrievalSemantics) ,public BavetAbstractBiConstraintStream<Solution_,A,B> filter(BiPredicate<A,B>) ,public BiConstraintStream<A,ResultB_> flattenLast(Function<B,Iterable<ResultB_>>) ,public List<BavetAbstractBiCons...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/bi/BavetIfExistsBiConstraintStream.java
BavetIfExistsBiConstraintStream
toString
class BavetIfExistsBiConstraintStream<Solution_, A, B, C> extends BavetAbstractBiConstraintStream<Solution_, A, B> { private final BavetAbstractBiConstraintStream<Solution_, A, B> parentAB; private final BavetIfExistsBridgeUniConstraintStream<Solution_, C> parentBridgeC; private final boolean shou...
return "IfExists() with " + childStreamList.size() + " children";
1,227
23
1,250
<methods>public void <init>(BavetConstraintFactory<Solution_>, org.optaplanner.constraint.streams.common.RetrievalSemantics) ,public BavetAbstractBiConstraintStream<Solution_,A,B> filter(BiPredicate<A,B>) ,public BiConstraintStream<A,ResultB_> flattenLast(Function<B,Iterable<ResultB_>>) ,public List<BavetAbstractBiCons...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/bi/BavetMapBridgeBiConstraintStream.java
BavetMapBridgeBiConstraintStream
buildNode
class BavetMapBridgeBiConstraintStream<Solution_, A, B, NewA> extends BavetAbstractBiConstraintStream<Solution_, A, B> { private final BavetAbstractBiConstraintStream<Solution_, A, B> parent; private final BiFunction<A, B, NewA> mappingFunction; private BavetMapUniConstraintStream<Solution_, NewA> ...
if (!childStreamList.isEmpty()) { throw new IllegalStateException("Impossible state: the stream (" + this + ") has a non-empty childStreamList (" + childStreamList + ") but it's a flattenLast bridge."); } int inputStoreIndex = buildHelper.reserveTupleStoreIndex(p...
478
179
657
<methods>public void <init>(BavetConstraintFactory<Solution_>, org.optaplanner.constraint.streams.common.RetrievalSemantics) ,public BavetAbstractBiConstraintStream<Solution_,A,B> filter(BiPredicate<A,B>) ,public BiConstraintStream<A,ResultB_> flattenLast(Function<B,Iterable<ResultB_>>) ,public List<BavetAbstractBiCons...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/bi/BavetQuadGroupBridgeBiConstraintStream.java
BavetQuadGroupBridgeBiConstraintStream
buildNode
class BavetQuadGroupBridgeBiConstraintStream<Solution_, A, B, NewA, NewB, NewC, NewD> extends BavetAbstractBiConstraintStream<Solution_, A, B> { private final BavetAbstractBiConstraintStream<Solution_, A, B> parent; private BavetGroupQuadConstraintStream<Solution_, NewA, NewB, NewC, NewD> groupStream; ...
List<? extends ConstraintStream> groupStreamChildList = groupStream.getChildStreamList(); nodeConstructor.build(buildHelper, parent.getTupleSource(), groupStream, groupStreamChildList, this, childStreamList, constraintFactory.getEnvironmentMode());
482
66
548
<methods>public void <init>(BavetConstraintFactory<Solution_>, org.optaplanner.constraint.streams.common.RetrievalSemantics) ,public BavetAbstractBiConstraintStream<Solution_,A,B> filter(BiPredicate<A,B>) ,public BiConstraintStream<A,ResultB_> flattenLast(Function<B,Iterable<ResultB_>>) ,public List<BavetAbstractBiCons...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/bi/BavetTriGroupBridgeBiConstraintStream.java
BavetTriGroupBridgeBiConstraintStream
buildNode
class BavetTriGroupBridgeBiConstraintStream<Solution_, A, B, NewA, NewB, NewC> extends BavetAbstractBiConstraintStream<Solution_, A, B> { private final BavetAbstractBiConstraintStream<Solution_, A, B> parent; private BavetGroupTriConstraintStream<Solution_, NewA, NewB, NewC> groupStream; private fi...
List<? extends ConstraintStream> groupStreamChildList = groupStream.getChildStreamList(); nodeConstructor.build(buildHelper, parent.getTupleSource(), groupStream, groupStreamChildList, this, childStreamList, constraintFactory.getEnvironmentMode());
460
66
526
<methods>public void <init>(BavetConstraintFactory<Solution_>, org.optaplanner.constraint.streams.common.RetrievalSemantics) ,public BavetAbstractBiConstraintStream<Solution_,A,B> filter(BiPredicate<A,B>) ,public BiConstraintStream<A,ResultB_> flattenLast(Function<B,Iterable<ResultB_>>) ,public List<BavetAbstractBiCons...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/bi/BavetUniGroupBridgeBiConstraintStream.java
BavetUniGroupBridgeBiConstraintStream
buildNode
class BavetUniGroupBridgeBiConstraintStream<Solution_, A, B, NewA> extends BavetAbstractBiConstraintStream<Solution_, A, B> { private final BavetAbstractBiConstraintStream<Solution_, A, B> parent; private BavetGroupUniConstraintStream<Solution_, NewA> groupStream; private final GroupNodeConstructor...
List<? extends ConstraintStream> groupStreamChildList = groupStream.getChildStreamList(); nodeConstructor.build(buildHelper, parent.getTupleSource(), groupStream, groupStreamChildList, this, childStreamList, constraintFactory.getEnvironmentMode());
437
66
503
<methods>public void <init>(BavetConstraintFactory<Solution_>, org.optaplanner.constraint.streams.common.RetrievalSemantics) ,public BavetAbstractBiConstraintStream<Solution_,A,B> filter(BiPredicate<A,B>) ,public BiConstraintStream<A,ResultB_> flattenLast(Function<B,Iterable<ResultB_>>) ,public List<BavetAbstractBiCons...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/bi/BiScorer.java
BiScorer
impact
class BiScorer<A, B> extends AbstractScorer<BiTuple<A, B>> { private final BiFunction<A, B, UndoScoreImpacter> scoreImpacter; public BiScorer(String constraintPackage, String constraintName, Score<?> constraintWeight, BiFunction<A, B, UndoScoreImpacter> scoreImpacter, int inputStoreIndex) { ...
try { return scoreImpacter.apply(tuple.getFactA(), tuple.getFactB()); } catch (Exception e) { throw createExceptionOnImpact(tuple, e); }
174
57
231
<methods>public final void insert(BiTuple<A,B>) ,public final void retract(BiTuple<A,B>) ,public final java.lang.String toString() ,public final void update(BiTuple<A,B>) <variables>private final non-sealed java.lang.String constraintId,private final non-sealed Score<?> constraintWeight,private final non-sealed int inp...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/bi/Group0Mapping2CollectorBiNode.java
Group0Mapping2CollectorBiNode
mergeCollectors
class Group0Mapping2CollectorBiNode<OldA, OldB, A, B, ResultContainerA_, ResultContainerB_> extends AbstractGroupBiNode<OldA, OldB, BiTuple<A, B>, BiTupleImpl<A, B>, Void, Object, Pair<A, B>> { private final int outputStoreSize; public Group0Mapping2CollectorBiNode(int groupStoreIndex, int undoStoreIn...
return (BiConstraintCollector<OldA, OldB, Object, Pair<A, B>>) ConstraintCollectors.compose(collectorA, collectorB, Pair::of);
474
50
524
<methods><variables>private final non-sealed TriFunction<java.lang.Object,OldA,OldB,java.lang.Runnable> accumulator
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/bi/Group0Mapping3CollectorBiNode.java
Group0Mapping3CollectorBiNode
mergeCollectors
class Group0Mapping3CollectorBiNode<OldA, OldB, A, B, C, ResultContainerA_, ResultContainerB_, ResultContainerC_> extends AbstractGroupBiNode<OldA, OldB, TriTuple<A, B, C>, TriTupleImpl<A, B, C>, Void, Object, Triple<A, B, C>> { private final int outputStoreSize; public Group0Mapping3CollectorBiNode(i...
return (BiConstraintCollector<OldA, OldB, Object, Triple<A, B, C>>) ConstraintCollectors.compose(collectorA, collectorB, collectorC, Triple::of);
566
55
621
<methods><variables>private final non-sealed TriFunction<java.lang.Object,OldA,OldB,java.lang.Runnable> accumulator
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/bi/Group0Mapping4CollectorBiNode.java
Group0Mapping4CollectorBiNode
updateOutTupleToResult
class Group0Mapping4CollectorBiNode<OldA, OldB, A, B, C, D, ResultContainerA_, ResultContainerB_, ResultContainerC_, ResultContainerD_> extends AbstractGroupBiNode<OldA, OldB, QuadTuple<A, B, C, D>, QuadTupleImpl<A, B, C, D>, Void, Object, Quadruple<A, B, C, D>> { private final int outputStoreSize;...
outTuple.factA = result.getA(); outTuple.factB = result.getB(); outTuple.factC = result.getC(); outTuple.factD = result.getD();
679
59
738
<methods><variables>private final non-sealed TriFunction<java.lang.Object,OldA,OldB,java.lang.Runnable> accumulator
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/bi/Group1Mapping3CollectorBiNode.java
Group1Mapping3CollectorBiNode
updateOutTupleToResult
class Group1Mapping3CollectorBiNode<OldA, OldB, A, B, C, D, ResultContainerB_, ResultContainerC_, ResultContainerD_> extends AbstractGroupBiNode<OldA, OldB, QuadTuple<A, B, C, D>, QuadTupleImpl<A, B, C, D>, A, Object, Triple<B, C, D>> { private final int outputStoreSize; public Group1Mapping3Collector...
outTuple.factB = result.getA(); outTuple.factC = result.getB(); outTuple.factD = result.getC();
441
45
486
<methods><variables>private final non-sealed TriFunction<java.lang.Object,OldA,OldB,java.lang.Runnable> accumulator
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/bi/Group2Mapping0CollectorBiNode.java
Group2Mapping0CollectorBiNode
createGroupKey
class Group2Mapping0CollectorBiNode<OldA, OldB, A, B> extends AbstractGroupBiNode<OldA, OldB, BiTuple<A, B>, BiTupleImpl<A, B>, Pair<A, B>, Void, Void> { private final int outputStoreSize; public Group2Mapping0CollectorBiNode(BiFunction<OldA, OldB, A> groupKeyMappingA, BiFunction<OldA, OldB, B> groupK...
OldA oldA = tuple.getFactA(); OldB oldB = tuple.getFactB(); A a = groupKeyMappingA.apply(oldA, oldB); B b = groupKeyMappingB.apply(oldA, oldB); return Pair.of(a, b);
425
77
502
<methods><variables>private final non-sealed TriFunction<java.lang.Void,OldA,OldB,java.lang.Runnable> accumulator
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/bi/Group3Mapping0CollectorBiNode.java
Group3Mapping0CollectorBiNode
createGroupKey
class Group3Mapping0CollectorBiNode<OldA, OldB, A, B, C> extends AbstractGroupBiNode<OldA, OldB, TriTuple<A, B, C>, TriTupleImpl<A, B, C>, Triple<A, B, C>, Void, Void> { private final int outputStoreSize; public Group3Mapping0CollectorBiNode(BiFunction<OldA, OldB, A> groupKeyMappingA, BiFunction<OldA,...
OldA oldA = tuple.getFactA(); OldB oldB = tuple.getFactB(); A a = groupKeyMappingA.apply(oldA, oldB); B b = groupKeyMappingB.apply(oldA, oldB); C c = groupKeyMappingC.apply(oldA, oldB); return Triple.of(a, b, c);
492
97
589
<methods><variables>private final non-sealed TriFunction<java.lang.Void,OldA,OldB,java.lang.Runnable> accumulator
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/common/AbstractFlattenLastNode.java
AbstractFlattenLastNode
calculateScore
class AbstractFlattenLastNode<InTuple_ extends Tuple, OutTuple_ extends Tuple, EffectiveItem_, FlattenedItem_> extends AbstractNode implements TupleLifecycle<InTuple_> { private final int flattenLastStoreIndex; private final Function<EffectiveItem_, Iterable<FlattenedItem_>> mappingFunction; ...
for (OutTuple_ outTuple : dirtyTupleQueue) { switch (outTuple.getState()) { case CREATING: nextNodesTupleLifecycle.insert(outTuple); outTuple.setState(BavetTupleState.OK); break; case UPDATING: ...
1,581
271
1,852
<methods>public non-sealed void <init>() ,public abstract void calculateScore() ,public void setId(long) ,public java.lang.String toString() <variables>private long id
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/common/AbstractMapNode.java
AbstractMapNode
insert
class AbstractMapNode<InTuple_ extends Tuple, Right_> extends AbstractNode implements TupleLifecycle<InTuple_> { private final int inputStoreIndex; /** * Calls for example {@link AbstractScorer#insert(Tuple)} and/or ... */ private final TupleLifecycle<UniTuple<Right_>> nextNodesTu...
if (tuple.getStore(inputStoreIndex) != null) { throw new IllegalStateException("Impossible state: the input for the tuple (" + tuple + ") was already added in the tupleStore."); } Right_ mapped = map(tuple); UniTuple<Right_> outTuple = new UniTupleImpl<>(...
900
125
1,025
<methods>public non-sealed void <init>() ,public abstract void calculateScore() ,public void setId(long) ,public java.lang.String toString() <variables>private long id
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/common/AbstractTuple.java
AbstractTuple
removeStore
class AbstractTuple implements Tuple { /* * We create a lot of tuples, many of them having store size of 1. * If an array of size 1 was created for each such tuple, memory would be wasted and indirection created. * This trade-off of increased memory efficiency for marginally slower access time is pr...
Value_ value; if (storeIsArray) { Object[] array = (Object[]) store; value = (Value_) array[index]; array[index] = null; } else { value = (Value_) store; store = null; } return value;
386
78
464
<no_super_class>
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/common/AbstractUnindexedIfExistsNode.java
AbstractUnindexedIfExistsNode
retractRight
class AbstractUnindexedIfExistsNode<LeftTuple_ extends Tuple, Right_> extends AbstractIfExistsNode<LeftTuple_, Right_> implements LeftTupleLifecycle<LeftTuple_>, RightTupleLifecycle<UniTuple<Right_>> { private final int inputStoreIndexLeftCounterEntry; private final int inputStoreIndexRightEnt...
TupleListEntry<UniTuple<Right_>> rightEntry = rightTuple.removeStore(inputStoreIndexRightEntry); if (rightEntry == null) { // No fail fast if null because we don't track which tuples made it through the filter predicate(s) return; } rightEntry.remove(); i...
1,560
130
1,690
<methods>public final void calculateScore() <variables>protected final non-sealed Queue<ExistsCounter<LeftTuple_>> dirtyCounterQueue,protected final non-sealed int inputStoreIndexLeftTrackerList,protected final non-sealed int inputStoreIndexRightTrackerList,protected final non-sealed boolean isFiltering,private final n...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/common/AbstractUnindexedJoinNode.java
AbstractUnindexedJoinNode
insertLeft
class AbstractUnindexedJoinNode<LeftTuple_ extends Tuple, Right_, OutTuple_ extends Tuple, MutableOutTuple_ extends OutTuple_> extends AbstractJoinNode<LeftTuple_, Right_, OutTuple_, MutableOutTuple_> implements LeftTupleLifecycle<LeftTuple_>, RightTupleLifecycle<UniTuple<Right_>> { private final i...
if (leftTuple.getStore(inputStoreIndexLeftEntry) != null) { throw new IllegalStateException("Impossible state: the input for the tuple (" + leftTuple + ") was already added in the tupleStore."); } TupleListEntry<LeftTuple_> leftEntry = leftTupleList.add(leftTuple...
1,177
184
1,361
<methods>public final void calculateScore() <variables>protected final non-sealed Queue<OutTuple_> dirtyTupleQueue,protected final non-sealed int inputStoreIndexLeftOutTupleList,protected final non-sealed int inputStoreIndexRightOutTupleList,private final non-sealed boolean isFiltering,private final non-sealed TupleLif...
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/common/BavetAbstractConstraintStream.java
BavetAbstractConstraintStream
assertBavetUniConstraintStream
class BavetAbstractConstraintStream<Solution_> extends AbstractConstraintStream<Solution_> { protected final BavetConstraintFactory<Solution_> constraintFactory; public BavetAbstractConstraintStream(BavetConstraintFactory<Solution_> constraintFactory, RetrievalSemantics retrievalSemantics) { ...
if (!(otherStream instanceof BavetAbstractUniConstraintStream)) { throw new IllegalStateException("The streams (" + this + ", " + otherStream + ") are not built from the same " + ConstraintFactory.class.getSimpleName() + "."); } BavetAbstractUniConstraintStream<S...
663
179
842
<methods>public abstract InnerConstraintFactory<Solution_,?> getConstraintFactory() ,public org.optaplanner.constraint.streams.common.RetrievalSemantics getRetrievalSemantics() <variables>private final non-sealed org.optaplanner.constraint.streams.common.RetrievalSemantics retrievalSemantics
apache_incubator-kie-optaplanner
incubator-kie-optaplanner/core/optaplanner-constraint-streams-bavet/src/main/java/org/optaplanner/constraint/streams/bavet/common/GroupNodeConstructorWithoutAccumulate.java
GroupNodeConstructorWithoutAccumulate
build
class GroupNodeConstructorWithoutAccumulate<Tuple_ extends Tuple> implements GroupNodeConstructor<Tuple_> { private final NodeConstructorWithoutAccumulate<Tuple_> nodeConstructorFunction; public GroupNodeConstructorWithoutAccumulate(NodeConstructorWithoutAccumulate<Tuple_> nodeConstructorFunction) { t...
if (!bridgeStreamChildList.isEmpty()) { throw new IllegalStateException("Impossible state: the stream (" + bridgeStream + ") has an non-empty childStreamList (" + bridgeStreamChildList + ") but it's a groupBy bridge."); } int groupStoreIndex = buildHelper.reserve...
223
185
408
<no_super_class>