Skip to content

Instantly share code, notes, and snippets.

View MgmtOlapJobBenchmark.java
@BenchmarkMode(Mode.AverageTime)
@Fork(1)
@State(Scope.Benchmark)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
public class MgmtOlapJobBenchmark {
@Param({"10000", "100000"})
int size;
JanusGraph graph;
@li-boxuan
li-boxuan / insert-10-million-nodes.java
Created Aug 30, 2021
Insert 10 million nodes into JanusGraph
View insert-10-million-nodes.java
graph = JanusGraphFactory.open("conf/janusgraph-cql-es.properties")
mgmt = graph.openManagement();
name = mgmt.makePropertyKey("name").dataType(String.class).cardinality(Cardinality.SINGLE).make();
mgmt.buildIndex("nameIndex", Vertex.class).addKey(name).buildCompositeIndex();
age = mgmt.makePropertyKey('age').dataType(Integer.class).make()
mgmt.buildIndex("ageIndex", Vertex.class).addKey(age).buildMixedIndex("search")
mgmt.commit();
@li-boxuan
li-boxuan / MultiQueryBenchmark.java
Created Jun 8, 2021
JanusGraph simple MultiQueryBenchmark
View MultiQueryBenchmark.java
package org.janusgraph.graphdb.query;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.janusgraph.core.Cardinality;
import org.janusgraph.core.JanusGraph;
import org.janusgraph.core.JanusGraphFactory;
import org.janusgraph.core.JanusGraphTransaction;
import org.janusgraph.core.PropertyKey;
import org.janusgraph.core.schema.JanusGraphManagement;
import org.janusgraph.diskstorage.configuration.ModifiableConfiguration;
@li-boxuan
li-boxuan / contributed_orgs.graphql
Last active Aug 14, 2018
Get a list of orgs which you have been contributed to on GitHub
View contributed_orgs.graphql
query($login: String!, $before: String){
user(login:$login) {
repositoriesContributedTo(last: 100, before: $before) {
pageInfo {
startCursor
hasPreviousPage
}
nodes {
owner {
login
@li-boxuan
li-boxuan / test sample.hs
Last active Mar 21, 2018
test sample for part one
View test sample.hs
Step 1.
Build a valid example and an invalid example separately. (why the latter one is invalid?)
> valid_example = unify (Function [TypeVar "s1", TypeVar "s2", TypeVar "s3"] (TypeVar "s3")) (Function [Bool_, TypeVar "s4", Int_] Int_)
> invalid_example = unify (Function [TypeVar "s1", TypeVar "s2", TypeVar "s3"] (TypeVar "s3")) (Function [Bool_, TypeVar "s4", Int_] Bool_)
Step 2.
Test the consolidate function
> valid_example >>= consolidate
@li-boxuan
li-boxuan / output.txt
Created Mar 21, 2018
Run coala on tutoria project repository
View output.txt
Executing section all...
Executing section all.whitespace...
Executing section all.python...
Executing section all.python.default...
Executing section all.python.models...
Executing section cli...
View command_line_output.txt
Executing section all...
Executing section all.whitespace...
[INFO][22:15:51] Applied 'ApplyPatchAction' on 'src/ssdb/test.cpp' from 'SpaceConsistencyBear'.
[INFO][22:15:51] Applied 'ApplyPatchAction' on 'src/ssdb/test.cpp' from 'SpaceConsistencyBear'.
[INFO][22:15:51] Applied 'ApplyPatchAction' on 'src/util/line.h' from 'SpaceConsistencyBear'.
[INFO][22:15:51] Applied 'ApplyPatchAction' on 'src/util/line.h' from 'SpaceConsistencyBear'.
[INFO][22:15:51] Applied 'ApplyPatchAction' on 'src/util/line.h' from 'SpaceConsistencyBear'.
[INFO][22:15:51] Applied 'ApplyPatchAction' on 'src/util/line.h' from 'SpaceConsistencyBear'.
[INFO][22:15:51] Applied 'ApplyPatchAction' on 'src/util/line.h' from 'SpaceConsistencyBear'.
[INFO][22:15:51] Applied 'ApplyPatchAction' on 'src/util/line.h' from 'SpaceConsistencyBear'.