profile
viewpoint
Misha Brukman mbrukman @Google https://misha.brukman.net/ Co-Founder, @JanusGraph • Startup/VC advisor

google/cmockery 687

A lightweight library to simplify and generalize the process of writing unit tests for C applications.

google/code-review-bot 67

Code review bot and CLA verifier

google/citest 56

Library and tools that facilitate writing integration-tests for cloud services

mbrukman/.tmux 0

🇫🇷 Oh My Tmux! Pretty & versatile tmux configuration made with ❤️

mbrukman/16counters 0

GUI for those who don't do GUI

mbrukman/1on1-questions 0

Mega list of 1 on 1 meeting questions compiled from a variety to sources

mbrukman/2048 0

A small clone of 1024 (https://play.google.com/store/apps/details?id=com.veewo.a1024)

mbrukman/3d-game-shaders-for-beginners 0

🎮 A step-by-step guide on how to implement SSAO, depth of field, lighting, normal mapping, and more for your 3D game.

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

      */     boolean hasUnorderedScan(); +    /**+     * Whether this storage backend supports keys order while running parallel scans

fixed

kptfh

comment created time in 6 hours

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

     KeyIterator getKeys(SliceQuery query, StoreTransaction txh) throws BackendException;     // like current getKeys if column-slice is such that it queries for vertex state property +    /**+     * Returns a {@link KeySlicesIterator} over all keys in the store that have one or more columns matching the column-range. Calling {@link KeyIterator#getEntries()}

fixed

kptfh

comment created time in 6 hours

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

     KeyIterator getKeys(SliceQuery query, StoreTransaction txh) throws BackendException;     // like current getKeys if column-slice is such that it queries for vertex state property +    /**+     * Returns a {@link KeySlicesIterator} over all keys in the store that have one or more columns matching the column-range. Calling {@link KeyIterator#getEntries()}+     * returns the list of all entries that match the column-range specified by the given queries.

fixed

kptfh

comment created time in 6 hours

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

     KeyIterator getKeys(SliceQuery query, StoreTransaction txh) throws BackendException;     // like current getKeys if column-slice is such that it queries for vertex state property +    /**+     * Returns a {@link KeySlicesIterator} over all keys in the store that have one or more columns matching the column-range. Calling {@link KeyIterator#getEntries()}+     * returns the list of all entries that match the column-range specified by the given queries.+     * <p>+     * This method is only supported by stores which do not guaranty key orders while running parallel scans.

fixed

kptfh

comment created time in 6 hours

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

+// Copyright 2017 JanusGraph Authors+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//      http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++package org.janusgraph.diskstorage.keycolumnvalue;++import org.janusgraph.diskstorage.Entry;+import org.janusgraph.diskstorage.StaticBuffer;+import org.janusgraph.diskstorage.util.RecordIterator;+import org.janusgraph.graphdb.olap.VertexJobConverter;++import java.util.Map;++/**+ * @author Sergii Karpenko (sergiy.karpenko@gmail.com)+ */++public interface KeySlicesIterator extends RecordIterator<StaticBuffer> {++    /**+     * Returns an iterator over all entries associated with the current

fixed

kptfh

comment created time in 6 hours

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

+// Copyright 2017 JanusGraph Authors+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//      http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++package org.janusgraph.diskstorage.keycolumnvalue.scan;++import org.janusgraph.diskstorage.BackendException;+import org.janusgraph.diskstorage.Entry;+import org.janusgraph.diskstorage.EntryList;+import org.janusgraph.diskstorage.PermanentBackendException;+import org.janusgraph.diskstorage.StaticBuffer;+import org.janusgraph.diskstorage.keycolumnvalue.KeyColumnValueStore;+import org.janusgraph.diskstorage.keycolumnvalue.KeySlicesIterator;+import org.janusgraph.diskstorage.keycolumnvalue.MultiSlicesQuery;+import org.janusgraph.diskstorage.keycolumnvalue.SliceQuery;+import org.janusgraph.diskstorage.keycolumnvalue.StoreTransaction;+import org.janusgraph.diskstorage.util.EntryArrayList;+import org.janusgraph.diskstorage.util.RecordIterator;+import org.slf4j.Logger;+import org.slf4j.LoggerFactory;++import java.io.IOException;+import java.util.HashMap;+import java.util.List;+import java.util.Map;+import java.util.concurrent.BlockingQueue;+import java.util.function.Predicate;++import static org.janusgraph.diskstorage.keycolumnvalue.scan.StandardScannerExecutor.Row;++/**+ *  Uses one thread for all queries. May be used for {@link KeyColumnValueStore}+ *  that do not guarantee keys order between different scans (f.e. Aerospike)+ * @author Sergii Karpenko (sergiy.karpenko@gmail.com)+ */++class SingleThreadScanner extends Scanner{++    private static final Logger log = LoggerFactory.getLogger(SingleThreadScanner.class);++    private final KeyColumnValueStore store;

fixed

kptfh

comment created time in 6 hours

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

+// Copyright 2017 JanusGraph Authors+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//      http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++package org.janusgraph.diskstorage.keycolumnvalue;++import org.janusgraph.diskstorage.StaticBuffer;++import java.util.List;+import java.util.Objects;++/**+ * Queries for a slices of data identified by a start points (inclusive) and end points (exclusive).

fixed

kptfh

comment created time in 6 hours

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

      */     boolean hasUnorderedScan(); +    /**+     * Whether this storage backend supports keys order while running parallel scans

Sounds perfect!

kptfh

comment created time in 6 hours

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

      * depending on the implementation, hence it is important to iterate over      * (and close) the RecordIterator before calling {@link #next()} or {@link #hasNext()}.      *+     * Important! Entries should be sorted inside iterator.

It's critical for VertexJobConverter.isGhostVertex. This method checks only first entry of each row

protected boolean isGhostVertex(long vertexId, EntryList firstEntries) {
        if (idManager.isPartitionedVertex(vertexId) && !idManager.isCanonicalVertexId(vertexId)) return false;

        RelationCache relCache = tx.getEdgeSerializer().parseRelation(
                firstEntries.get(0),true,tx);
        return relCache.typeId != BaseKey.VertexExists.longId();
    }
kptfh

comment created time in 7 hours

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

      * depending on the implementation, hence it is important to iterate over      * (and close) the RecordIterator before calling {@link #next()} or {@link #hasNext()}.      *+     * Important! Entries should be sorted inside iterator.+     * Otherwise {@link VertexJobConverter} will not work correctly

It's critical for VertexJobConverter.isGhostVertex. This method checks only first entry of each row

protected boolean isGhostVertex(long vertexId, EntryList firstEntries) {
        if (idManager.isPartitionedVertex(vertexId) && !idManager.isCanonicalVertexId(vertexId)) return false;

        RelationCache relCache = tx.getEdgeSerializer().parseRelation(
                firstEntries.get(0),true,tx);
        return relCache.typeId != BaseKey.VertexExists.longId();
    }
kptfh

comment created time in 7 hours

Pull request review commentJanusGraph/janusgraph

Enhance GraphCentricQuery profiling

+// Copyright 2021 JanusGraph Authors+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//      http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++package org.janusgraph.graphdb.util;++import org.apache.tinkerpop.gremlin.structure.util.CloseableIterator;+import org.janusgraph.core.JanusGraphElement;+import org.janusgraph.graphdb.query.profile.QueryProfiler;++import java.util.Iterator;+import java.util.function.Supplier;++/**+ * @author Boxuan Li (liboxuan@connect.hku.hk)+ */+public class ProfiledIterator<E extends JanusGraphElement> extends CloseableAbstractIterator<E> {+    private final QueryProfiler profiler;+    private Iterator<E> iterator;+    private boolean timerRunning;++    public ProfiledIterator(QueryProfiler profiler, Supplier<Iterator<E>> iteratorSupplier) {+        this.profiler = profiler;+        profiler.startTimer();+        timerRunning = true;+        iterator = iteratorSupplier.get();

I had to revert this piece of logic, otherwise, JanusGraphIndexTest::testOrForceIndexPartialIndex would fail. The reason is when we put the "iteratorSupplier.get()" logic into the computeNext() method, the computation is lazy (delayed). In that test case, if the computation is delayed, there will be no exception for "g.V().or(.has("name", "Totoro"),.has("age", 2)).hasNext();" because the first condition uses index and returns a result (thus, the second condition is not yet evaluated). On the contrary, if the computation is not delayed, the second condition will throw an exception because it does not use an index, and force-index is enabled.

In fact, I think this actually demonstrates the benefit of lazy computation, but since this would change the behavior and can have a non-trivial impact, I would rather leave it as a follow-up issue (to discuss further whether we shall do so or not).

li-boxuan

comment created time in 7 hours

startedlwkd/lwkd.github.io

started time in 7 hours

pull request commentJanusGraph/janusgraph

Refactor JanusGraphServer in preperation for a GRPC server

@li-boxuan Do you any comments?

farodin91

comment created time in 8 hours

Pull request review commentJanusGraph/janusgraph

Enhance GraphCentricQuery profiling

+// Copyright 2021 JanusGraph Authors+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//      http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++package org.janusgraph.graphdb.util;++import org.apache.tinkerpop.gremlin.structure.util.CloseableIterator;+import org.janusgraph.core.JanusGraphElement;+import org.janusgraph.graphdb.query.profile.QueryProfiler;++import java.util.Iterator;+import java.util.function.Supplier;++/**+ * @author Boxuan Li (liboxuan@connect.hku.hk)+ */+public class ProfiledIterator<E extends JanusGraphElement> extends CloseableAbstractIterator<E> {+    private final QueryProfiler profiler;+    private Iterator<E> iterator;+    private boolean timerRunning;++    public ProfiledIterator(QueryProfiler profiler, Supplier<Iterator<E>> iteratorSupplier) {+        this.profiler = profiler;+        profiler.startTimer();+        timerRunning = true;+        iterator = iteratorSupplier.get();

That actually sounds like a legitimate case. I have changed the logic.

li-boxuan

comment created time in 9 hours

push eventJanusGraph/janusgraph-foundationdb

Randy Hu

commit sha c04fcff88647b0efff7a2c1d181e1da206ebbd9c

Add range and partition support on FoundationDB adapter for batch processing (#48) Signed-off-by: Randy Hu <ruweih@gmail.com>

view details

push time in 14 hours

pull request commentJanusGraph/janusgraph-foundationdb

Add range and partition support on FoundationDB adapter for batch processing

@davisdk Thanks for reminding me. Since there were no remarks by others, we can merge this PR now.

ruweih

comment created time in 14 hours

issue openedJanusGraph/janusgraph-docker

Container is not terminated on failure of docker-entrypoint-initdb.d groovy scripts

I've written graph initialisation groovy script and mounted to docker-entrypoint-initdb.d. I'm expecting that the container will terminate if the script throws any exception.

Since I'm using kubernetes, if the script fails with some connection error and the container is not terminated, kubernetes will not try to restart it.

Is it the default behaviour of this image or do I need to configure something so that the container is terminated if initialisation script fails

created time in a day

pull request commentJanusGraph/janusgraph-foundationdb

Add range and partition support on FoundationDB adapter for batch processing

I've also got my eyes on this one. :] Any chance we can get it merged shortly? Thanks!

ruweih

comment created time in a day

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

      */     boolean hasUnorderedScan(); +    /**+     * Whether this storage backend supports keys order while running parallel scans

"Whether this storage backend supports keys order while running parallel scans" seems to suggest when hasInconsistentScan() is true, key order is consistent while running parallel scans.

My suggestion is, we could make this method "hasConsistentScan()". Then the doc could be,

Whether this storage backend supports a consistent key order among different scans. If it supports ordered scan, it must support consistent key scan. If it doesn't support ordered scan, it may or may not support consistent key scan. If the consistent scan is not supported, the backend shall support {@link KeyColumnValueStore#getKeys(MultiSlicesQuery, StoreTransaction)}

kptfh

comment created time in a day

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

      * depending on the implementation, hence it is important to iterate over      * (and close) the RecordIterator before calling {@link #next()} or {@link #hasNext()}.      *+     * Important! Entries should be sorted inside iterator.

Isn't the iterator itself ought to be sorted? From my understanding, the entries returned by the "getEntries()" don't have to be sorted.

kptfh

comment created time in a day

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

+// Copyright 2017 JanusGraph Authors+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//      http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++package org.janusgraph.diskstorage.keycolumnvalue.scan;++import org.janusgraph.diskstorage.BackendException;+import org.janusgraph.diskstorage.Entry;+import org.janusgraph.diskstorage.EntryList;+import org.janusgraph.diskstorage.PermanentBackendException;+import org.janusgraph.diskstorage.StaticBuffer;+import org.janusgraph.diskstorage.keycolumnvalue.KeyColumnValueStore;+import org.janusgraph.diskstorage.keycolumnvalue.KeySlicesIterator;+import org.janusgraph.diskstorage.keycolumnvalue.MultiSlicesQuery;+import org.janusgraph.diskstorage.keycolumnvalue.SliceQuery;+import org.janusgraph.diskstorage.keycolumnvalue.StoreTransaction;+import org.janusgraph.diskstorage.util.EntryArrayList;+import org.janusgraph.diskstorage.util.RecordIterator;+import org.slf4j.Logger;+import org.slf4j.LoggerFactory;++import java.io.IOException;+import java.util.HashMap;+import java.util.List;+import java.util.Map;+import java.util.concurrent.BlockingQueue;+import java.util.function.Predicate;++import static org.janusgraph.diskstorage.keycolumnvalue.scan.StandardScannerExecutor.Row;++/**+ *  Uses one thread for all queries. May be used for {@link KeyColumnValueStore}+ *  that do not guarantee keys order between different scans (f.e. Aerospike)+ * @author Sergii Karpenko (sergiy.karpenko@gmail.com)+ */++class SingleThreadScanner extends Scanner{++    private static final Logger log = LoggerFactory.getLogger(SingleThreadScanner.class);++    private final KeyColumnValueStore store;

Seems you don't need this since "KeyColumnValueStore store" is declared in its superclass already.

kptfh

comment created time in a day

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

+// Copyright 2017 JanusGraph Authors+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//      http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++package org.janusgraph.diskstorage.keycolumnvalue.scan;++import org.janusgraph.diskstorage.PermanentBackendException;+import org.janusgraph.diskstorage.TemporaryBackendException;+import org.janusgraph.diskstorage.keycolumnvalue.KeyColumnValueStore;++import java.util.concurrent.BlockingQueue;++import static org.janusgraph.diskstorage.keycolumnvalue.scan.StandardScannerExecutor.Row;++/**+ * Produces data to {@link BlockingQueue<Row>}+ * for each key in {@link KeyColumnValueStore}+ *+ * @author Sergii Karpenko (sergiy.karpenko@gmail.com)+ */+abstract class Scanner {

"rename Scanner to RecordsCollector" sounds like a plan to me. After all, it only collects data but not processes it.

kptfh

comment created time in a day

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

+// Copyright 2017 JanusGraph Authors+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//      http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++package org.janusgraph.diskstorage.keycolumnvalue;++import org.janusgraph.diskstorage.StaticBuffer;++import java.util.List;+import java.util.Objects;++/**+ * Queries for a slices of data identified by a start points (inclusive) and end points (exclusive).

(nitpick) the code already expresses itself, but the wording "a slices of data" can be a bit hard to understand. Maybe we could say "a list of slices of data, each identified by ..."

kptfh

comment created time in a day

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

+// Copyright 2017 JanusGraph Authors+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//      http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++package org.janusgraph.diskstorage.keycolumnvalue;++import org.janusgraph.diskstorage.Entry;+import org.janusgraph.diskstorage.StaticBuffer;+import org.janusgraph.diskstorage.util.RecordIterator;+import org.janusgraph.graphdb.olap.VertexJobConverter;++import java.util.Map;++/**+ * @author Sergii Karpenko (sergiy.karpenko@gmail.com)+ */++public interface KeySlicesIterator extends RecordIterator<StaticBuffer> {++    /**+     * Returns an iterator over all entries associated with the current

This seems inaccurate. Apparently, it returns a map rather than an iterator.

kptfh

comment created time in a day

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

      * depending on the implementation, hence it is important to iterate over      * (and close) the RecordIterator before calling {@link #next()} or {@link #hasNext()}.      *+     * Important! Entries should be sorted inside iterator.+     * Otherwise {@link VertexJobConverter} will not work correctly

Should we say "otherwise {@link MultiThreadsScanner} will not work correctly"?

kptfh

comment created time in a day

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

     KeyIterator getKeys(SliceQuery query, StoreTransaction txh) throws BackendException;     // like current getKeys if column-slice is such that it queries for vertex state property +    /**+     * Returns a {@link KeySlicesIterator} over all keys in the store that have one or more columns matching the column-range. Calling {@link KeyIterator#getEntries()}+     * returns the list of all entries that match the column-range specified by the given queries.+     * <p>+     * This method is only supported by stores which do not guaranty key orders while running parallel scans.

(nitpick) I think other stores could still optionally implement this method. Probably we could say it is mandatory for stores that do not guaranty ...

kptfh

comment created time in a day

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

     KeyIterator getKeys(SliceQuery query, StoreTransaction txh) throws BackendException;     // like current getKeys if column-slice is such that it queries for vertex state property +    /**+     * Returns a {@link KeySlicesIterator} over all keys in the store that have one or more columns matching the column-range. Calling {@link KeyIterator#getEntries()}
     * Returns a {@link KeySlicesIterator} over all keys in the store that have one or more columns matching the column-range. Calling {@link KeySlicesIterator#getEntries()}
kptfh

comment created time in a day

Pull request review commentJanusGraph/janusgraph

KeySlicesIterator introduced

     KeyIterator getKeys(SliceQuery query, StoreTransaction txh) throws BackendException;     // like current getKeys if column-slice is such that it queries for vertex state property +    /**+     * Returns a {@link KeySlicesIterator} over all keys in the store that have one or more columns matching the column-range. Calling {@link KeyIterator#getEntries()}+     * returns the list of all entries that match the column-range specified by the given queries.

Seems it returns a map rather than a list.

kptfh

comment created time in a day

created repositorygbin/oric-vgm-player

This is a crude VGM player for the Oric Atmos.

created time in a day

more