Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update gremlin #5

Open
dmill-bz opened this issue Apr 7, 2016 · 15 comments
Open

update gremlin #5

dmill-bz opened this issue Apr 7, 2016 · 15 comments

Comments

@dmill-bz
Copy link
Owner

dmill-bz commented Apr 7, 2016

Don't need to use master anymore. Can update simply which will prevent having to generate the lib.

@billho
Copy link

billho commented Aug 25, 2016

I use gremlin-console-js to connect gremlin server 3.2.1 , and I meet a problem - all of the user share the same graph, one make some change against the graph will affect the otherone. How can I do to isolate everyone's data space? Looking forward to your reply. Thank U very much.

@dmill-bz
Copy link
Owner Author

Hey @billho

Yes this is probably because you have the graph handled in the server configuration. You will need some logic to separate the spaces.
This really depends on what you are trying to accomplish. For www.gremlinBin.com the configuration has no graph set : graphs: {}

The graphs are set for each individual instance by running an initial query such as :

graph = TinkerFactory.createModern();
g = graph.traversal(standard());

The bindings (graph & g) are local to the session.

You can do this with the console automatically by following the instructions in the Populating the console on init section. That is to say with :

// Start an instance of gremlin-console
var gc = GremlinConsole('#console-window', '#console-input');
// Provide a history array to populate the graph
// In this case we create a modern graph "graph", with a traversal object "g".
gc.populateDbFromHistory([
  {query: "graph = TinkerFactory.createModern();", error: undefined, results: [null]},
  {query: "g = graph.traversal();", error: undefined, results: [null]}
]);

If you want to be able to persist each user's graph between connections then you will need to add some more logic. Most likely you would create a gremlin-server plugin or use some form of partitioning.

Let me know if you have any other questions.

Cheers

@billho
Copy link

billho commented Aug 25, 2016

@PommeVerte
Thank you for your reply! And I do as you say.

First, I set the configuration gremlin-server.yaml no graph set : graphs: {}

Secondly, I initial query like that:


var gc = gremlinConsole.create('#window', '#input');
    gc.populateDbFromHistory([
      {query: "graph = TinkerFactory.createModern();", error: undefined, results: [null]},
      {query: "g = graph.traversal();", error: undefined, results: [null]}
    ]);

but , still has problem:

gremlin> g
Could not complete query => No such property: g for class: Script2 (Error 597)

What's wrong ?

Thank you for your help!

@dmill-bz
Copy link
Owner Author

dmill-bz commented Aug 25, 2016

Can you show me your full gremlin-server.yaml file please? Sounds like somehow the session isn't being maintained but I find that very odd as it should be automatic.
Also, are you getting any errors in the browser console before running any queries? (ie: when gremlin-console initializes)

@billho
Copy link

billho commented Aug 25, 2016

There is no errors in the browser before running queries.

And the full gremlin-server.yaml as below :


host: localhost
port: 8182
threadPoolWorker: 1
gremlinPool: 8
scriptEvaluationTimeout: 30000
channelizer: org.apache.tinkerpop.gremlin.server.channel.WebSocketChannelizer
graphs: { }
plugins:
  - tinkerpop.tinkergraph
scriptEngines: {
  gremlin-groovy: {
    imports: [java.lang.Math],
    staticImports: [java.lang.Math.PI],
    scripts: [scripts/empty-sample.groovy]},
  nashorn: {
      imports: [java.lang.Math],
      staticImports: [java.lang.Math.PI]}}
serializers:
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { useMapperFromGraph: graph }}            # application/vnd.gremlin-v1.0+gryo
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoLiteMessageSerializerV1d0, config: { useMapperFromGraph: graph }}        # application/vnd.gremlin-v1.0+gryo-lite
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GryoMessageSerializerV1d0, config: { serializeResultToString: true }}        # application/vnd.gremlin-v1.0+gryo-stringd
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerGremlinV1d0, config: { useMapperFromGraph: graph }} # application/vnd.gremlin-v1.0+json
  - { className: org.apache.tinkerpop.gremlin.driver.ser.GraphSONMessageSerializerV1d0, config: { useMapperFromGraph: graph }}        # application/json
processors:
  - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 288 }}
metrics: {
  consoleReporter: {enabled: true, interval: 180000},
  csvReporter: {enabled: true, interval: 180000, fileName: /tmp/gremlin-server-metrics.csv},
  jmxReporter: {enabled: true},
  slf4jReporter: {enabled: true, interval: 180000},
  gangliaReporter: {enabled: false, interval: 180000, addressingMode: MULTICAST},
  graphiteReporter: {enabled: false, interval: 180000}}
strictTransactionManagement: false
threadPoolBoss: 1
maxInitialLineLength: 4096
maxHeaderSize: 8192
maxChunkSize: 8192
maxContentLength: 65536
maxAccumulationBufferComponents: 1024
resultIterationBatchSize: 64
writeBufferLowWaterMark: 32768
writeBufferHighWaterMark: 65536
ssl: {
  enabled: false}

@dmill-bz
Copy link
Owner Author

I can't find anything wrong. This is even weirder from the fact that tests seem to pass on travis. Though it tests gremlin-server 3.1.1. I think I'll try and update gremlin-server and see if there's a compatibility issue with 3.2.1

@billho
Copy link

billho commented Aug 25, 2016

OK,Thank you. And I will try 3.1.1 then.

@dmill-bz
Copy link
Owner Author

A created PR #6 to test gremlin-server 3.2.1 and the tests are passing.

Specifically these two :

If trying 3.1.1 works for you then chances are I'm missing a test.

@dmill-bz
Copy link
Owner Author

Mental note to self: The gremlin-server.yaml used for testing has a graph set up. Perhaps it would be wise to write another test to cover generating custom graphs.

@billho
Copy link

billho commented Aug 26, 2016

I change to 3.1.1 , and there are no errors.
And then I check the configuration of 3.2.1 again , I found the timeout is too small

processors:
  - { className: org.apache.tinkerpop.gremlin.server.op.session.SessionOpProcessor, config: { sessionTimeout: 288 }}

I think that why the errors comes when I use 3.2.1 .

@dmill-bz
Copy link
Owner Author

Ah, does changing the timeout make it work? Or are you stil experiencing issues?

@billho
Copy link

billho commented Aug 28, 2016

Yes, it works . And no problem now.

@billho
Copy link

billho commented Sep 11, 2016

Sorry to tell you i meet issues agains. when i use :
var gc = gremlinConsole.create('#console-window', '#console-input', {host: "localhost", port: 8182});
error:
image

but if use :
var gc = gremlinConsole.create('#console-window', '#console-input');

everything is right.

@dmill-bz
Copy link
Owner Author

dmill-bz commented Sep 11, 2016

Interesting. Which browser is this? I've been meaning to set tests up for better cross browser coverage. Maybe it's time I do it.

Mental note to add https://github.com/PommeVerte/gremlin-console-js/blob/master/test/ConsoleTest.js#L28-L41 to indexTest.js

@billho
Copy link

billho commented Sep 12, 2016

Chrome v52.0.2743.116 m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants