GitHub user okuc opened a pull request:

    https://github.com/apache/incubator-tinkerpop/pull/265

    When hosts configured incorrectly, causing problems not connect services

    Mainly to solve the following problem:
    
    I have two machines, machine name and ip as follows:
    
    ```
               ip                             hostname
    192.168.1.1                         host11
    192.168.1.2                         host12
    
    ```
    I start gremlin-server on 192.168.1.1, and then access on 192.168.1.2.
    
    But for some reason, the hosts file on the 192.168.1.2 is not configured 
correctly, as follows:
    
    `192.168.1.1 host33`
    
    So I'm on the 192.168.1.2, it will report an error when accessing the 
gremlin-server. My statement is as follows access
    
    ```
      Builder builder = Cluster.build ( "192.168.1.1");
      Cluster cluster = builder.create ();
      Client client = cluster.connect ();
      ResultSet results = client.submit ( "[1,2,3,4]");
      results.stream () forEach (System.out :: println).;
    ```
    It reported the following error:
    
    ```
    Exception in thread "main" java.lang.RuntimeException: 
java.lang.RuntimeException: java.util.concurrent.TimeoutException: Timed out 
waiting for an available host.
    at org.apache.tinkerpop.gremlin.driver.Client.submit (Client.java:146)
    at org.apache.tinkerpop.gremlin.driver.Client.submit (Client.java:130)
    at com.okuc.graph.hello.remote.main (remote.java:27)
    Caused by: java.lang.RuntimeException: 
java.util.concurrent.TimeoutException: Timed out waiting for an available host.
    at org.apache.tinkerpop.gremlin.driver.Client.submitAsync (Client.java:194)
    at org.apache.tinkerpop.gremlin.driver.Client.submitAsync (Client.java:174)
    at org.apache.tinkerpop.gremlin.driver.Client.submit (Client.java:144)
    ... 2 more
    Caused by: java.util.concurrent.TimeoutException: Timed out waiting for an 
available host.
    at org.apache.tinkerpop.gremlin.driver.Client $ 
ClusteredClient.chooseConnection (Client.java:342)
    at org.apache.tinkerpop.gremlin.driver.Client.submitAsync (Client.java:189)
    ... 4 more
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/okuc/incubator-tinkerpop tp31

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-tinkerpop/pull/265.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #265
    
----
commit 873174e8218aef31f2220928ab16463aeda650cd
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-01T16:29:14Z

    Started working on GraphComputer.vertices() and GraphComputer.edges(). Have 
it working (untested) for SparkGraphComputer. The same pattern will flow over 
to GiraphGraphComputer. There are some issues regarding semantics in 
TinkerGraphComputer. Will bring up with a [DISCUSS].

commit 3b3e008ce03d1f63610b92ff79886376d9dc55f7
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-01T19:38:42Z

    GraphComputerTest now verifies that graph filters work -- 
GraphComputer.vertices() and GraphComputer.edges(). SparkGraphComputer 
implements graph filters correctly. TinkerGraph and Giraph throw 
UnsupportOperationException at this point (i.e. TODO). Had to add remove() 
methods to many of the inner Iterator anonymous classes in IteratorUtils and 
MultiIterator. Basically, they just call remove() on the wrapped iterator. 
Thus, cleanly backwards compatible. Added GraphFilterAware interface will allow 
InputFormats to say whether or not they do vertex/edge-filtering on graph load. 
Nothing connected to that yet, but GryoInputFormat (and smart providers) will 
be able to leverage this interface. Still a work in progress....

commit 3485d8454855938fd7c0c24d5c3f9c3eb6ab308a
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-01T21:45:48Z

    Created a CommonFileInputFormat abstract class that both GryoInputFormat 
and ScriptInputFormat now extend. It handles all vertex/edge filter 
construction and has helper methods for filtering the StarVertex prior to being 
fully loaded by the InputFormat. This is really nice as we can now tweak vertex 
loading to a pretty intense degree especially with GryoInputFormat (e.g. once 
properties are loaded, check vertex filter and thus, don't even deserialize the 
edges). How it is right now, the full Vertex is materialized, then validated 
before the InputFormat will nextKeyValue().

commit 77732ddd5f60bbd65a445390e590da34bea1db2f
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-01T21:59:04Z

    tweaks to filtered boolean check.

commit 64c684065143b75697ccac755b9dfbf943c8c54c
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-01T23:46:07Z

    GiraphGraphComputer now has support for vertexFilters and edgeFilters. 
Consolidated a bunch of code to make it easy for future InputFormats to be 
GraphFilterAware. Will most likely make a filterMap so variables are bundled 
nicely.

commit bc417dbf01fee817aa325ee8e4b582fef8ab6788
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-02T00:44:19Z

    created a GraphFilter container object that makes storing and applying 
filters easy. Very clean model. GraphFilter will next contain stuff like 
inferences on the filters so easy push-down predicates are available to the 
graph system provider.

commit d0ac65277702b703c1ab2257adcbf67b0699b959
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-02T15:55:14Z

    GraphFilter is now a really cool class. It is part of gremlin-core/computer 
and provides access to GraphComputer vertices() and edges() load filters. It 
also provides direct support for filtering StarVertex vertices (as most OLAP 
systems will leverage StarVertex). Its StarVertex support is nice in that 
GraphFilter analyzes the edgesFilter and can do bulk dropEdges() to prune the 
StarVertex fast. Whatever it can't do in bulk, it then runs the edgeFilter over 
the remaining edges. GraphComputerTest.shouldSupportGraphFilter() ensures that 
the graph is properly pruned. I have some ideas about pushing GraphFilter down 
to the StarVertex deserializer, but will need @spmallette help on that. If we 
can do that, then we can get some BLAZING speeds for highly pruned OLAP 
operations.

commit eee16c9354602a49e7dfb7738f2ce4d9fe36152c
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-02T19:17:59Z

    TinkerGraph now supports GraphComputer GraphFilter. Sort of an elegant 
solution that makes use of tagging elements that are legal or not. As of right 
now, the full test suite passes (integration too). GraphFilter works -- this is 
going to be huge for speeding up OLAP times.

commit 7ad48f20586ec58b1fea7018fa8f37ec8c95c9b9
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-02T19:44:57Z

    added a MapReduce test. We now verify that GraphFilter works for both 
VertexProgram+MapReduce and MapReduce only. TinkerGraph and Spark integration 
tests pass.

commit 72e388c4a1eadb6654a422988857006ed27b6158
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-02T19:53:54Z

    added nice GraphFilter.legalVertex() and GraphFilter.legalEdges() methods 
so that the provider doesn't have to be smart about how to apply the underlying 
filter traversal.

commit e4cf925b496ee250f7dca48d094e8b93816ca075
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-02T20:24:45Z

    Added a state-based test case to GraphFilter. About to run this thing on 
the Blade cluster against Friendster to see how well we do now.

commit 7023987a0b5154646a4d77e0b2b3506e850ed3d2
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-02T20:35:27Z

    Forgot to add vertices() and edges() to the 
ComputerTraversalEngine.Builder. I can't wait for this model to go away in 
favor of a fluent TraversalSource.

commit 6cfb1f22f43fa82be10d04fc28e86e8f3db9d28e
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-02T21:24:38Z

    found a bug in TraversalUtil.isLocalStarGraph(). Added 
TraversalUtil.isLocalVertex() (for only checking properties -- no edge access). 
Added JavaDoc to new GraphComputer methods. Added verfication that the provided 
traversals don't leave their respective boundaries.

commit f7ad5c4f6a7b197cebb86fa22d4c263ce6b3365b
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-02T21:49:22Z

    Added standard GraphComputer.Exceptions for GraphFilter and verfiy 
Exceptions are thrown correctly in GraphComputerTest. Tweaks to JavaDoc.

commit b824d0c0994276e3714dc59341aa24526127eafe
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-03T18:03:23Z

    Created specialized serializers for common classes in Spark to avoid the 
overhead of JavaSerialization.

commit 4afe29a80fb15f965924297fafda942adeb36b06
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-03T18:09:46Z

    forgot a Serialization that popped up when taking things to the cluster.

commit 1c9a31c4c3d3f09c829d135363ad7ebff6590c8d
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-03T19:49:53Z

    Learned about ExternalizableSerializer which makes registration of Kryo 
serializers alot more simple. Ran this code on the cluster -- what took 25 
minutes now takes 6.8 minutes.

commit 097e09a39a151e6dbb8ebb268bc1792baac8765a
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-03T20:48:31Z

    minor nothings.

commit 001a13dec5d3bb7ffa269fa2e392947d5c600a5e
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-03T21:28:59Z

    Merge branch 'master' into TINKERPOP-962

commit 569496f671f4e532fc459cee54da3e6e62522ac1
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-04T14:36:31Z

    Merge branch 'master' into TINKERPOP-962

commit 07f7a8c614493de4bd13d2e75292609c5ee7183c
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-04T17:42:24Z

    Moved GraphFilterTest to gremlin-groovy/ so I can use reflection and not 
have to make internal variables protected for testing purposes. 
Optional<Vertex> GraphReader.readVertex(InputStream,GraphFilter) now exists at 
the interface level with an UnsupportedOperationException default. GryoReader 
can now read vertices from a GraphFilter-perspective and only materialize those 
vertices/edges that are legal. Should be fairly trivial to add to 
GraphSONReader.

commit b3d3116e5f287e61d44993af3e709c7d04bf77ac
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-04T20:00:00Z

    was using null to represent a filtered vertex. went with Optional 
throughout so the API is consistent.

commit a28b1fdc673bb6a11b741d306e3706efc4510592
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-04T20:23:12Z

    method rename. pointless twiddling.

commit 25e5b24049ef22d1bb64ae652d6ff5cba4786451
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-04T20:51:12Z

    ensure that the context is closed after the test suite has completed.

commit ed18cd9382ee1e2db7f4618a72e9d28ed6b2fb2a
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-04T22:51:08Z

    OMG, the most insane bug for the last two hours. Painfull......

commit 5021135451605cfec4212babb721fedeb425c07f
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-05T07:09:04Z

    Created a GraphFilterInputFormat which, if the user provided INPUT_FORMAT 
is not GraphFilterAware, it will filter the vertex before sending it up the I/O 
stack. Thus, GraphSONInputFormat, which is currently NOT GraphFilterAware, is 
wrapped by GraphFilterInputFormat.  This greatly simplifies the complexity of 
dealing with GraphFilters in Hadoop (Giraph vs. MapReduce -- e.g.). Along the 
way, I did lots of nice clean up and organiation of our various input/output 
formats and readers/writers. We had alot of anti-patterns that I have since 
cleaned.

commit 4134254c510150e9c9314dc85d25be54dd1a4a9f
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-05T08:35:50Z

    Added JavaDoc to GraphFilter and GraphFilterInputFormat. More JavaDoc to 
GraphFilter along the way...

commit 482ccdad79105871582e464217d363f735b87611
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-05T16:50:26Z

    StarGraph is no longer special to GraphFilter. All the filtering methods 
for StarGraph that were weirdly in GraphFilter are now just in StarGraph -- 
i.e. StarGraph.applyGraphFilter(GraphFilter). We may want to create an 
interface moving forward like Filterable which requires an 
applyGraphFilter(GraphFilter) implementation. Added more test cases 
GraphComputerTest -- we now test graph filtering for the VERTEX_PROGRAM, 
VERTEX_PROGRAM+MAP_REDUCE, MAP_REDUCE. A slight optimization to MapReduceHelper 
(Giraph) where if there was a VERTEX_PROGRAM, no need to use a GraphFilter as 
its already been filtered by the VERTEX_PROGRAM InputFormat.

commit da75577790915dfac18e61206aa77c223841153b
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-05T17:53:14Z

    dah. groovy reflection-based test cases. lame.

commit 1b8d881fa7d07eeb831eae2d2935e1ade8aa3b0e
Author: Marko A. Rodriguez <okramma...@gmail.com>
Date:   2016-02-06T19:54:34Z

    updated CHANGELOG with 3.2.0 section. We need a new logo.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to