Uploaded image for project: 'TinkerPop'
  1. TinkerPop
  2. TINKERPOP-2252

a meaningful way to support session based byteCode interaction through gremlin-driver

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.5.0
    • Fix Version/s: 3.5.0
    • Component/s: groovy
    • Labels:
      None

      Description

      As in  topic https://groups.google.com/forum/#!topic/gremlin-users/cHl4FB-H7Nc  we have discussed,TinkerPop currently support:

      1. Script sessionLess which is auto transaction;
      2. ByteCode sessionLess which is also auto transaction;
      3. Script session which user could control transaction through g.tx().open / rollback / commit;

      As we knows that ByteCode based requests are themselves code written in the native language and  could be checked to validate the Gremlin during the development process。 => so many user prefer to use ByteCode over Script。

      But as we known,auto transaction need to persistence data changes per request which needs high cost and in some scenarios user even unbearable。=>  so in some  performance sensitive situation user prefer to use sessionBased interaction over sessionLess。

      Here,we face the real trouble: if user need both  high performance and  good write experience,we  sank into  despair  because we do not support byteCode session,here is another user‘s sample:https://stackoverflow.com/questions/55454068/tinkerpop-gremlin-transaction-processor-with-bytecode

      We must solve this problem even it is in less use because we all want to provide sufficiently good service to our user,but  better transaction support in TP4 is still far away。 Here is my simple and meaningful solution:

      We can provide a function which change byteCode into Parameterized Scripts (not a simple Script which we already have, Its performance is 10X lower) 。 Yes,we just need to add a new translate function in "org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyTranslator.java"。

      The code is ready and through test, if anyone agree that this it's meaningful, i will submit PR later,  thanks for your patience。

      The user code would  like:

       

        Attachments

        1. image-2019-07-02-10-23-50-901.png
          548 kB
          Stark Arya
        2. image-2019-07-02-22-04-16-651.png
          303 kB
          Stark Arya
        3. image-2019-07-02-22-05-38-063.png
          466 kB
          Stark Arya
        4. image-2019-07-02-22-19-19-539.png
          327 kB
          Stark Arya
        5. image-2019-07-08-22-54-28-628.png
          75 kB
          Stark Arya
        6. image-2019-07-08-22-56-15-682.png
          9 kB
          Stark Arya

          Activity

            People

            • Assignee:
              spmallette Stephen Mallette
              Reporter:
              Stark Arya Stark Arya
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: