hugegraph-test/src/main/java/org/apache/hugegraph/core/VertexCoreTest.java [2099:2158]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
              .ifNotExist().create();

        this.init10VerticesAndCommit();

        String author = graph.vertexLabel("author").id().asString();
        Id id1 = SplicingIdGenerator.splicing(author,
                                              LongEncoding.encodeNumber(1));
        Id id2 = SplicingIdGenerator.splicing(author,
                                              LongEncoding.encodeNumber(2));

        String language = graph.vertexLabel("language").id().asString();
        Id id3 = SplicingIdGenerator.splicing(language, "java");
        Id id4 = SplicingIdGenerator.splicing(language, "c++");
        Id id5 = SplicingIdGenerator.splicing(language, "python");

        String book = graph.vertexLabel("book").id().asString();
        Id id6 = SplicingIdGenerator.splicing(book, "java-1");
        Id id7 = SplicingIdGenerator.splicing(book, "java-2");
        Id id8 = SplicingIdGenerator.splicing(book, "java-3");
        Id id9 = SplicingIdGenerator.splicing(book, "java-4");
        Id id10 = SplicingIdGenerator.splicing(book, "java-5");

        graph.addVertex(T.id, id1.asObject(), olapPropName, "a");
        graph.addVertex(T.id, id2.asObject(), olapPropName, "b");
        graph.addVertex(T.id, id3.asObject(), olapPropName, "c");
        graph.addVertex(T.id, id4.asObject(), olapPropName, "d");
        graph.addVertex(T.id, id5.asObject(), olapPropName, "e");
        graph.addVertex(T.id, id6.asObject(), olapPropName, "f");
        graph.addVertex(T.id, id7.asObject(), olapPropName, "g");
        graph.addVertex(T.id, id8.asObject(), olapPropName, "h");
        graph.addVertex(T.id, id9.asObject(), olapPropName, "i");
        graph.addVertex(T.id, id10.asObject(), olapPropName, "j");

        this.commitTx();

        Assert.assertEquals(GraphReadMode.OLTP_ONLY, graph.readMode());
        Assert.assertThrows(NotAllowException.class, () -> {
            graph.traversal().V().has(olapPropName, "a").hasNext();
        }, e -> {
            Assert.assertContains("Not allowed to query by olap property key",
                                  e.getMessage());
        });

        Assert.assertEquals(GraphReadMode.OLTP_ONLY, graph.readMode());
        Assert.assertThrows(NotAllowException.class, () -> {
            graph.traversal().V().has(olapPropName, "c").hasNext();
        }, e -> {
            Assert.assertContains("Not allowed to query by olap property key",
                                  e.getMessage());
        });

        Assert.assertEquals(GraphReadMode.OLTP_ONLY, graph.readMode());
        Assert.assertThrows(NotAllowException.class, () -> {
            graph.traversal().V().has(olapPropName, "f").hasNext();
        }, e -> {
            Assert.assertContains("Not allowed to query by olap property key",
                                  e.getMessage());
        });

        graph.readMode(GraphReadMode.ALL);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



hugegraph-test/src/main/java/org/apache/hugegraph/core/VertexCoreTest.java [2185:2244]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
              .ifNotExist().create();

        this.init10VerticesAndCommit();

        String author = graph.vertexLabel("author").id().asString();
        Id id1 = SplicingIdGenerator.splicing(author,
                                              LongEncoding.encodeNumber(1));
        Id id2 = SplicingIdGenerator.splicing(author,
                                              LongEncoding.encodeNumber(2));

        String language = graph.vertexLabel("language").id().asString();
        Id id3 = SplicingIdGenerator.splicing(language, "java");
        Id id4 = SplicingIdGenerator.splicing(language, "c++");
        Id id5 = SplicingIdGenerator.splicing(language, "python");

        String book = graph.vertexLabel("book").id().asString();
        Id id6 = SplicingIdGenerator.splicing(book, "java-1");
        Id id7 = SplicingIdGenerator.splicing(book, "java-2");
        Id id8 = SplicingIdGenerator.splicing(book, "java-3");
        Id id9 = SplicingIdGenerator.splicing(book, "java-4");
        Id id10 = SplicingIdGenerator.splicing(book, "java-5");

        graph.addVertex(T.id, id1.asObject(), olapPropName, "a");
        graph.addVertex(T.id, id2.asObject(), olapPropName, "b");
        graph.addVertex(T.id, id3.asObject(), olapPropName, "c");
        graph.addVertex(T.id, id4.asObject(), olapPropName, "d");
        graph.addVertex(T.id, id5.asObject(), olapPropName, "e");
        graph.addVertex(T.id, id6.asObject(), olapPropName, "f");
        graph.addVertex(T.id, id7.asObject(), olapPropName, "g");
        graph.addVertex(T.id, id8.asObject(), olapPropName, "h");
        graph.addVertex(T.id, id9.asObject(), olapPropName, "i");
        graph.addVertex(T.id, id10.asObject(), olapPropName, "j");

        this.commitTx();

        Assert.assertEquals(GraphReadMode.OLTP_ONLY, graph.readMode());
        Assert.assertThrows(NotAllowException.class, () -> {
            graph.traversal().V().has(olapPropName, "a").hasNext();
        }, e -> {
            Assert.assertContains("Not allowed to query by olap property key",
                                  e.getMessage());
        });

        Assert.assertEquals(GraphReadMode.OLTP_ONLY, graph.readMode());
        Assert.assertThrows(NotAllowException.class, () -> {
            graph.traversal().V().has(olapPropName, "c").hasNext();
        }, e -> {
            Assert.assertContains("Not allowed to query by olap property key",
                                  e.getMessage());
        });

        Assert.assertEquals(GraphReadMode.OLTP_ONLY, graph.readMode());
        Assert.assertThrows(NotAllowException.class, () -> {
            graph.traversal().V().has(olapPropName, "f").hasNext();
        }, e -> {
            Assert.assertContains("Not allowed to query by olap property key",
                                  e.getMessage());
        });

        graph.readMode(GraphReadMode.ALL);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



