Copilot commented on code in PR #3021:
URL: https://github.com/apache/hugegraph/pull/3021#discussion_r3246647311
##########
install-dist/scripts/dependency/known-dependencies.txt:
##########
@@ -164,7 +164,8 @@ hamcrest-2.2.jar
hamcrest-core-1.3.jar
hanlp-portable-1.5.0.jar
hanlp-portable-1.8.3.jar
-hbase-shaded-endpoint-2.0.6.jar
+hbase-endpoint-2.6.5.jar
+hbase-shaded-client-2.6.5.jar
Review Comment:
The known-dependencies allowlist only adds `hbase-endpoint-2.6.5.jar` and
`hbase-shaded-client-2.6.5.jar`, but moving from the single self-contained
`hbase-shaded-endpoint-2.0.6.jar` to the official HBase 2.6.5 `hbase-endpoint`
artifact pulls in a substantial set of transitive jars that were previously
bundled (e.g. hbase-common, hbase-protocol, hbase-protocol-shaded,
hbase-server, hbase-mapreduce, hbase-metrics, hbase-metrics-api,
hbase-hadoop-compat, hbase-hadoop2-compat, hbase-zookeeper,
hbase-shaded-miscellaneous, hbase-shaded-netty, hbase-shaded-protobuf, possibly
hadoop-* even after exclusions). `check_dependencies.sh` will fail the build
whenever an unlisted jar is produced. Please run the dependency check after a
full build and add every newly introduced jar (and remove any 2.0.6-era entries
that are no longer pulled in) to keep the allowlist consistent.
##########
docker/HBASE.md:
##########
@@ -0,0 +1,425 @@
+# HBase Backend Testing with Docker
+
+This guide explains how to start HBase locally with Docker, verify it is
working, and validate HugeGraph API operations.
+
+> **All commands in this guide should be run from the repository root** unless
otherwise noted.
+
+> **Recent path change**: The HBase compose file moved from
`docker/docker-compose.hbase.yml` to `docker/hbase/docker-compose.hbase.yml`.
If you have older shell history/scripts, update `-f` accordingly.
+
+> **Security note**: The HBase Docker build enforces SHA512 verification by
default and fails when checksum download/parsing/validation fails. Only use
`--build-arg ALLOW_UNVERIFIED_DOWNLOAD=true` for trusted test environments with
restricted networks.
+
+---
+
+## Quick Start
+
+### 0. (Optional) Clean Up Leftover HBase Tables
Review Comment:
Step 0 is titled "(Optional) Clean Up Leftover HBase Tables" but the command
underneath is `docker compose ... build --no-cache hbase`, which actually
builds the image — it does nothing related to cleaning up tables. The same
"Clean Up Leftover HBase Tables" title is reused (correctly this time) for Step
3 at line 36. Step 0's title should be changed (e.g. "Build the HBase Image")
to match what its command actually does; otherwise readers will be misled.
##########
hugegraph-server/hugegraph-hbase/pom.xml:
##########
@@ -27,24 +27,49 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>hugegraph-hbase</artifactId>
-
+ <properties>
+ <hbase.version>2.6.5</hbase.version>
+ </properties>
<dependencies>
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hugegraph-core</artifactId>
<version>${revision}</version>
</dependency>
+ <!--
+ hbase-endpoint must come before hbase-shaded-client so that the
+ unshaded LongColumnInterpreter (using com.google.protobuf) is on
+ the classpath ahead of the shaded variant, allowing
AggregationClient
+ rowCount() generic bounds to resolve correctly.
+ -->
<dependency>
- <groupId>com.baidu.hugegraph</groupId>
- <artifactId>hbase-shaded-endpoint</artifactId>
- <version>2.0.6</version>
+ <groupId>org.apache.hbase</groupId>
+ <artifactId>hbase-endpoint</artifactId>
+ <version>${hbase.version}</version>
<exclusions>
<exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
+ <groupId>org.apache.hbase</groupId>
+ <artifactId>hbase-server</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-common</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-hdfs</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-mapreduce-client-core</artifactId>
</exclusion>
</exclusions>
Review Comment:
`hbase-endpoint` at 2.6.5 transitively depends on `hbase-server` (it
contains coprocessor implementations such as `AggregateImplementation` which
the HugeGraph CountSession registers via `COPROCESSOR_AGGR`). Excluding
`hbase-server` here may remove the very classes the endpoint relies on at
runtime, and will also strip dependent classes used by `AggregationClient`.
Please verify that the count/aggregation code path still works against a live
HBase cluster after this exclusion (the current PR description only mentions
schema/vertex/gremlin sanity checks, not aggregation/count operations). If
`hbase-server` is required, remove the exclusion and instead exclude only the
specific heavyweight transitives you want to drop.
##########
docker/hbase/entrypoint.sh:
##########
@@ -0,0 +1,57 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+set -e
+
+echo "Starting HBase ${HBASE_VERSION} standalone..."
+
+# Start services explicitly to avoid SSH-based helper assumptions in containers
+${HBASE_HOME}/bin/hbase-daemon.sh start zookeeper
+${HBASE_HOME}/bin/hbase-daemon.sh start master
+${HBASE_HOME}/bin/hbase-daemon.sh start regionserver
+
+echo "HBase started. Waiting for ZooKeeper on port 2181..."
+zk_attempts=0
+until nc -z localhost 2181; do
+ zk_attempts=$((zk_attempts + 1))
+ if [ "$zk_attempts" -ge 120 ]; then
+ echo "Timed out waiting for ZooKeeper on 2181"
+ ${HBASE_HOME}/bin/hbase-daemon.sh status || true
+ exit 1
+ fi
+ sleep 1
+done
+echo "ZooKeeper is ready."
+
+echo "Waiting for HBase Master..."
+master_attempts=0
+until echo "status 'simple'" | ${HBASE_HOME}/bin/hbase shell -n 2>/dev/null |
grep -E -q
"([1-9][0-9]*[[:space:]]+live[[:space:]]+servers|[1-9][0-9]*[[:space:]]+servers|servers:[[:space:]]*[1-9])";
do
+ master_attempts=$((master_attempts + 1))
+ if [ "$master_attempts" -ge 180 ]; then
+ echo "Timed out waiting for HBase master/regionserver readiness"
+ ${HBASE_HOME}/bin/hbase-daemon.sh status || true
+ tail -n 80 ${HBASE_HOME}/logs/hbase--*.out 2>/dev/null || true
+ exit 1
+ fi
+ sleep 3
+done
+echo "HBase is ready. Master + RegionServer online."
+
+# Tail all daemon logs so `docker logs` includes startup/runtime issues
+exec tail -F ${HBASE_HOME}/logs/hbase--*.out ${HBASE_HOME}/logs/hbase--*.log
2>/dev/null || \
+ tail -f /dev/null
Review Comment:
`exec tail -F ... 2>/dev/null || tail -f /dev/null` doesn't actually provide
the intended fallback: once `exec` replaces the shell with `tail`, the `||`
branch can never run (the shell is gone). If the primary `tail` exits non-zero
(e.g. because the glob expands to no files and tail treats the literal name as
missing), the container will exit instead of falling back to `tail -f
/dev/null`. Either drop the `exec` so the `||` works, or explicitly check that
files exist first.
##########
docker/hbase/Dockerfile:
##########
@@ -0,0 +1,101 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Standalone HBase 2.6.5 image for HugeGraph HBase backend testing.
+# Exposes ZooKeeper on 2181 with znode /hbase (matching hugegraph.properties
defaults).
+
+FROM eclipse-temurin:11-jre-jammy
+
+ARG HBASE_VERSION=2.6.5
+ARG
HBASE_PRIMARY_URL=https://downloads.apache.org/hbase/${HBASE_VERSION}/hbase-${HBASE_VERSION}-bin.tar.gz
Review Comment:
`downloads.apache.org` only hosts the *currently active* releases. As soon
as HBase 2.6.5 is superseded by a newer patch release, the primary URL will
return 404 and every Docker build will incur the fallback to
`archive.apache.org`. This is functional but slow and noisy. Consider either
using `archive.apache.org` as the primary (it's stable for all historical
versions) or documenting that the primary URL is expected to break over time.
##########
docker/hbase/Dockerfile:
##########
@@ -0,0 +1,101 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Standalone HBase 2.6.5 image for HugeGraph HBase backend testing.
+# Exposes ZooKeeper on 2181 with znode /hbase (matching hugegraph.properties
defaults).
+
+FROM eclipse-temurin:11-jre-jammy
+
+ARG HBASE_VERSION=2.6.5
+ARG
HBASE_PRIMARY_URL=https://downloads.apache.org/hbase/${HBASE_VERSION}/hbase-${HBASE_VERSION}-bin.tar.gz
+ARG
HBASE_FALLBACK_URL=https://archive.apache.org/dist/hbase/${HBASE_VERSION}/hbase-${HBASE_VERSION}-bin.tar.gz
+ARG ALLOW_UNVERIFIED_DOWNLOAD=false
+
+ENV HBASE_VERSION=${HBASE_VERSION}
+ENV HBASE_HOME=/opt/hbase
+ENV PATH=${HBASE_HOME}/bin:${PATH}
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ curl \
+ netcat-openbsd \
+ && rm -rf /var/lib/apt/lists/*
+
+RUN set -eux; \
+ download_ok=0; \
+ for url in "${HBASE_PRIMARY_URL}" "${HBASE_FALLBACK_URL}"; do \
+ [ -n "${url}" ] || continue; \
+ echo "Downloading HBase from ${url}"; \
+ if curl -fL --retry 8 --retry-delay 5 --retry-all-errors \
+ --connect-timeout 30 --max-time 1800 "${url}" -o
/tmp/hbase.tar.gz; then \
+ download_ok=1; \
+ break; \
+ fi; \
+ echo "Download failed for ${url}, trying next source..."; \
+ rm -f /tmp/hbase.tar.gz; \
+ done; \
+ if [ "${download_ok}" -ne 1 ]; then \
+ echo "Unable to download HBase ${HBASE_VERSION} tarball from
configured sources"; \
+ exit 1; \
+ fi; \
+ if curl -fL --retry 5 --retry-delay 3 --retry-all-errors \
+ --connect-timeout 30 "${HBASE_PRIMARY_URL}.sha512" -o
/tmp/hbase.tar.gz.sha512 2>/dev/null || \
+ curl -fL --retry 5 --retry-delay 3 --retry-all-errors \
+ --connect-timeout 30 "${HBASE_FALLBACK_URL}.sha512" -o
/tmp/hbase.tar.gz.sha512 2>/dev/null; then \
+ echo "Verifying SHA512 checksum..."; \
+ expected_hash=$(grep -Eio '[a-f0-9]{128}' /tmp/hbase.tar.gz.sha512 |
head -n 1 | tr 'A-F' 'a-f' || true); \
+ if [ -z "$expected_hash" ]; then \
+ expected_hash=$(awk '{for (i = 1; i <= NF; i++) if ($i ~
/^[0-9A-Fa-f]+$/) hash = hash $i} END {if (length(hash) >= 128) print
tolower(substr(hash, 1, 128))}' /tmp/hbase.tar.gz.sha512 || true); \
Review Comment:
The awk fallback that builds `hash` by concatenating every hex-looking token
in the file can produce an incorrect 128-char string when the `.sha512` is in
Apache's grouped format (e.g. `hbase-2.6.5-bin.tar.gz: 6F09 1234 ABCD ...
5678`). The filename token `hbase-2.6.5-bin.tar.gz:` contains substrings that
match `[0-9A-Fa-f]+` (e.g. `2`, `6`, `5`, `bin`), and `awk` will concatenate
those onto the hash, shifting all subsequent bytes and producing a hash that is
wrong (or rejected by the `length >= 128` check by coincidence). Restrict the
regex to hex-only tokens of a minimum length (e.g. `length($i) >= 8 && $i ~
/^[0-9A-Fa-f]+$/`) and/or skip the first token (the filename).
##########
docker/hbase/Dockerfile:
##########
@@ -0,0 +1,101 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Standalone HBase 2.6.5 image for HugeGraph HBase backend testing.
+# Exposes ZooKeeper on 2181 with znode /hbase (matching hugegraph.properties
defaults).
+
+FROM eclipse-temurin:11-jre-jammy
+
+ARG HBASE_VERSION=2.6.5
+ARG
HBASE_PRIMARY_URL=https://downloads.apache.org/hbase/${HBASE_VERSION}/hbase-${HBASE_VERSION}-bin.tar.gz
+ARG
HBASE_FALLBACK_URL=https://archive.apache.org/dist/hbase/${HBASE_VERSION}/hbase-${HBASE_VERSION}-bin.tar.gz
+ARG ALLOW_UNVERIFIED_DOWNLOAD=false
+
+ENV HBASE_VERSION=${HBASE_VERSION}
+ENV HBASE_HOME=/opt/hbase
+ENV PATH=${HBASE_HOME}/bin:${PATH}
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ curl \
+ netcat-openbsd \
+ && rm -rf /var/lib/apt/lists/*
+
+RUN set -eux; \
+ download_ok=0; \
+ for url in "${HBASE_PRIMARY_URL}" "${HBASE_FALLBACK_URL}"; do \
+ [ -n "${url}" ] || continue; \
+ echo "Downloading HBase from ${url}"; \
+ if curl -fL --retry 8 --retry-delay 5 --retry-all-errors \
+ --connect-timeout 30 --max-time 1800 "${url}" -o
/tmp/hbase.tar.gz; then \
+ download_ok=1; \
+ break; \
+ fi; \
+ echo "Download failed for ${url}, trying next source..."; \
+ rm -f /tmp/hbase.tar.gz; \
+ done; \
+ if [ "${download_ok}" -ne 1 ]; then \
+ echo "Unable to download HBase ${HBASE_VERSION} tarball from
configured sources"; \
+ exit 1; \
+ fi; \
+ if curl -fL --retry 5 --retry-delay 3 --retry-all-errors \
+ --connect-timeout 30 "${HBASE_PRIMARY_URL}.sha512" -o
/tmp/hbase.tar.gz.sha512 2>/dev/null || \
+ curl -fL --retry 5 --retry-delay 3 --retry-all-errors \
+ --connect-timeout 30 "${HBASE_FALLBACK_URL}.sha512" -o
/tmp/hbase.tar.gz.sha512 2>/dev/null; then \
+ echo "Verifying SHA512 checksum..."; \
Review Comment:
The checksum download only attempts `${HBASE_PRIMARY_URL}.sha512` and
`${HBASE_FALLBACK_URL}.sha512`, but the tarball download loop iterates over
both URLs. If the primary tarball download succeeds and the primary `.sha512`
404s (e.g. when the user supplied a corporate-mirror `HBASE_PRIMARY_URL` that
doesn't host `.sha512`), the fallback `.sha512` from `archive.apache.org` may
correspond to the same artifact and verify OK — but if a user overrides
`HBASE_PRIMARY_URL` to a non-Apache mirror, both `.sha512` requests can succeed
for the wrong checksum or both fail and the build aborts (default). Consider
downloading the checksum from the same URL the tarball actually came from, and
document that custom mirrors must host the matching `.sha512`.
##########
hugegraph-server/hugegraph-hbase/pom.xml:
##########
@@ -27,24 +27,49 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>hugegraph-hbase</artifactId>
-
+ <properties>
+ <hbase.version>2.6.5</hbase.version>
+ </properties>
<dependencies>
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hugegraph-core</artifactId>
<version>${revision}</version>
</dependency>
+ <!--
+ hbase-endpoint must come before hbase-shaded-client so that the
+ unshaded LongColumnInterpreter (using com.google.protobuf) is on
+ the classpath ahead of the shaded variant, allowing
AggregationClient
+ rowCount() generic bounds to resolve correctly.
+ -->
<dependency>
- <groupId>com.baidu.hugegraph</groupId>
- <artifactId>hbase-shaded-endpoint</artifactId>
- <version>2.0.6</version>
+ <groupId>org.apache.hbase</groupId>
+ <artifactId>hbase-endpoint</artifactId>
+ <version>${hbase.version}</version>
<exclusions>
<exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
+ <groupId>org.apache.hbase</groupId>
+ <artifactId>hbase-server</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-common</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-hdfs</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-mapreduce-client-core</artifactId>
</exclusion>
</exclusions>
Review Comment:
The PR title and description state that the dependency exclusions on
`hbase-endpoint` are designed to "avoid pulling heavyweight server/hadoop
transitive components not needed by HugeGraph runtime", but the comment on
lines 39-44 explains a completely different rationale (ordering relative to
`hbase-shaded-client` so the unshaded `LongColumnInterpreter` resolves). These
two motivations are independent and only the latter is captured in code
comments. Please also document why `hbase-server` is being excluded despite
`hbase-endpoint` typically depending on it, so future maintainers don't
accidentally re-add it and break the runtime classpath assumptions.
##########
hugegraph-server/hugegraph-hbase/pom.xml:
##########
@@ -27,24 +27,49 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>hugegraph-hbase</artifactId>
-
+ <properties>
+ <hbase.version>2.6.5</hbase.version>
+ </properties>
<dependencies>
<dependency>
<groupId>org.apache.hugegraph</groupId>
<artifactId>hugegraph-core</artifactId>
<version>${revision}</version>
</dependency>
+ <!--
+ hbase-endpoint must come before hbase-shaded-client so that the
+ unshaded LongColumnInterpreter (using com.google.protobuf) is on
+ the classpath ahead of the shaded variant, allowing
AggregationClient
+ rowCount() generic bounds to resolve correctly.
+ -->
<dependency>
- <groupId>com.baidu.hugegraph</groupId>
- <artifactId>hbase-shaded-endpoint</artifactId>
- <version>2.0.6</version>
+ <groupId>org.apache.hbase</groupId>
+ <artifactId>hbase-endpoint</artifactId>
+ <version>${hbase.version}</version>
<exclusions>
<exclusion>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
+ <groupId>org.apache.hbase</groupId>
+ <artifactId>hbase-server</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-common</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-hdfs</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.apache.hadoop</groupId>
+ <artifactId>hadoop-mapreduce-client-core</artifactId>
</exclusion>
Review Comment:
The previous dependency excluded `log4j:log4j` to avoid pulling the
vulnerable Log4j 1.x into the runtime classpath. The new
`hbase-endpoint`/`hbase-server` chain still transitively brings in log4j (HBase
2.6.x bundles log4j 1.2.x via slf4j-log4j12 / log4j-over-slf4j shims depending
on profile). Please re-add the `log4j:log4j` (and consider
`log4j:apache-log4j-extras`, `org.slf4j:slf4j-log4j12`) exclusions on the new
`hbase-endpoint` dependency, or confirm via `mvn dependency:tree` that no log4j
1.x artifact is reintroduced.
##########
docker/hbase/entrypoint.sh:
##########
@@ -0,0 +1,57 @@
+#!/bin/bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+set -e
+
+echo "Starting HBase ${HBASE_VERSION} standalone..."
+
+# Start services explicitly to avoid SSH-based helper assumptions in containers
+${HBASE_HOME}/bin/hbase-daemon.sh start zookeeper
+${HBASE_HOME}/bin/hbase-daemon.sh start master
+${HBASE_HOME}/bin/hbase-daemon.sh start regionserver
+
+echo "HBase started. Waiting for ZooKeeper on port 2181..."
+zk_attempts=0
+until nc -z localhost 2181; do
+ zk_attempts=$((zk_attempts + 1))
+ if [ "$zk_attempts" -ge 120 ]; then
+ echo "Timed out waiting for ZooKeeper on 2181"
+ ${HBASE_HOME}/bin/hbase-daemon.sh status || true
+ exit 1
+ fi
+ sleep 1
+done
+echo "ZooKeeper is ready."
+
+echo "Waiting for HBase Master..."
+master_attempts=0
+until echo "status 'simple'" | ${HBASE_HOME}/bin/hbase shell -n 2>/dev/null |
grep -E -q
"([1-9][0-9]*[[:space:]]+live[[:space:]]+servers|[1-9][0-9]*[[:space:]]+servers|servers:[[:space:]]*[1-9])";
do
+ master_attempts=$((master_attempts + 1))
+ if [ "$master_attempts" -ge 180 ]; then
+ echo "Timed out waiting for HBase master/regionserver readiness"
+ ${HBASE_HOME}/bin/hbase-daemon.sh status || true
+ tail -n 80 ${HBASE_HOME}/logs/hbase--*.out 2>/dev/null || true
+ exit 1
+ fi
+ sleep 3
+done
+echo "HBase is ready. Master + RegionServer online."
+
+# Tail all daemon logs so `docker logs` includes startup/runtime issues
+exec tail -F ${HBASE_HOME}/logs/hbase--*.out ${HBASE_HOME}/logs/hbase--*.log
2>/dev/null || \
+ tail -f /dev/null
Review Comment:
The tail glob `${HBASE_HOME}/logs/hbase--*.out` (and similarly
`hbase--*.log`) contains a double dash, which only matches log files where
`HBASE_IDENT_STRING` is empty. HBase's daemon scripts default
`HBASE_IDENT_STRING` to `$USER`, so when the container runs as root the actual
log filenames are `hbase-root-master-*.log` / `hbase-root-regionserver-*.log`
and the glob will not match. The command then silently falls back to `tail -f
/dev/null`, meaning `docker logs` will not include any HBase runtime output —
defeating the purpose of this step. Use a glob like
`${HBASE_HOME}/logs/hbase-*.log` (single dash) or explicitly set
`HBASE_IDENT_STRING=""` before starting the daemons.
##########
docker/hbase/hbase-site.xml:
##########
@@ -0,0 +1,89 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ -->
+<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
+<configuration>
+ <!-- Standalone mode: use local filesystem -->
+ <property>
+ <name>hbase.rootdir</name>
+ <value>/tmp/hbase</value>
+ </property>
+ <!-- Embedded ZooKeeper data directory -->
+ <property>
+ <name>hbase.zookeeper.property.dataDir</name>
+ <value>/tmp/zookeeper</value>
+ </property>
Review Comment:
`hbase.rootdir` is set to `/tmp/hbase` (and ZooKeeper data to
`/tmp/zookeeper`). In standalone/pseudo-distributed HBase, `hbase.rootdir` is
interpreted with the default filesystem scheme — for a path without a scheme
this typically resolves to HDFS in a Hadoop install, and to `file:///tmp/hbase`
in a no-Hadoop install. Relying on this implicit scheme is fragile. Please use
an explicit `file:///tmp/hbase` value (and `file:///tmp/zookeeper` is
unnecessary because that path is ZooKeeper-local) to ensure HBase boots in
local-FS mode regardless of the environment. Also, `/tmp` is regularly cleaned
by some distros/CI; the compose volume mount mitigates that on the host, but
documenting the choice (or using `/var/lib/hbase`) would be safer.
##########
docker/hbase/Dockerfile:
##########
@@ -0,0 +1,101 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# Standalone HBase 2.6.5 image for HugeGraph HBase backend testing.
+# Exposes ZooKeeper on 2181 with znode /hbase (matching hugegraph.properties
defaults).
+
+FROM eclipse-temurin:11-jre-jammy
+
+ARG HBASE_VERSION=2.6.5
+ARG
HBASE_PRIMARY_URL=https://downloads.apache.org/hbase/${HBASE_VERSION}/hbase-${HBASE_VERSION}-bin.tar.gz
+ARG
HBASE_FALLBACK_URL=https://archive.apache.org/dist/hbase/${HBASE_VERSION}/hbase-${HBASE_VERSION}-bin.tar.gz
+ARG ALLOW_UNVERIFIED_DOWNLOAD=false
+
+ENV HBASE_VERSION=${HBASE_VERSION}
+ENV HBASE_HOME=/opt/hbase
+ENV PATH=${HBASE_HOME}/bin:${PATH}
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ curl \
+ netcat-openbsd \
+ && rm -rf /var/lib/apt/lists/*
+
+RUN set -eux; \
+ download_ok=0; \
+ for url in "${HBASE_PRIMARY_URL}" "${HBASE_FALLBACK_URL}"; do \
+ [ -n "${url}" ] || continue; \
+ echo "Downloading HBase from ${url}"; \
+ if curl -fL --retry 8 --retry-delay 5 --retry-all-errors \
+ --connect-timeout 30 --max-time 1800 "${url}" -o
/tmp/hbase.tar.gz; then \
+ download_ok=1; \
+ break; \
+ fi; \
+ echo "Download failed for ${url}, trying next source..."; \
+ rm -f /tmp/hbase.tar.gz; \
+ done; \
+ if [ "${download_ok}" -ne 1 ]; then \
+ echo "Unable to download HBase ${HBASE_VERSION} tarball from
configured sources"; \
+ exit 1; \
+ fi; \
+ if curl -fL --retry 5 --retry-delay 3 --retry-all-errors \
+ --connect-timeout 30 "${HBASE_PRIMARY_URL}.sha512" -o
/tmp/hbase.tar.gz.sha512 2>/dev/null || \
+ curl -fL --retry 5 --retry-delay 3 --retry-all-errors \
+ --connect-timeout 30 "${HBASE_FALLBACK_URL}.sha512" -o
/tmp/hbase.tar.gz.sha512 2>/dev/null; then \
+ echo "Verifying SHA512 checksum..."; \
+ expected_hash=$(grep -Eio '[a-f0-9]{128}' /tmp/hbase.tar.gz.sha512 |
head -n 1 | tr 'A-F' 'a-f' || true); \
+ if [ -z "$expected_hash" ]; then \
+ expected_hash=$(awk '{for (i = 1; i <= NF; i++) if ($i ~
/^[0-9A-Fa-f]+$/) hash = hash $i} END {if (length(hash) >= 128) print
tolower(substr(hash, 1, 128))}' /tmp/hbase.tar.gz.sha512 || true); \
+ fi; \
+ if [ -n "$expected_hash" ]; then \
+ actual_hash=$(sha512sum /tmp/hbase.tar.gz | awk '{print $1}'); \
+ if [ "$expected_hash" = "$actual_hash" ]; then \
+ echo "SHA512 verified OK"; \
+ else \
+ echo "ERROR: SHA512 mismatch"; \
+ echo " Expected: $expected_hash"; \
+ echo " Actual: $actual_hash"; \
+ exit 1; \
+ fi; \
+ else \
+ if [ "${ALLOW_UNVERIFIED_DOWNLOAD}" = "true" ]; then \
+ echo "WARNING: Could not parse SHA512 file
(ALLOW_UNVERIFIED_DOWNLOAD=true)"; \
+ else \
+ echo "ERROR: Could not parse SHA512 file"; \
+ exit 1; \
+ fi; \
+ fi; \
+ else \
+ if [ "${ALLOW_UNVERIFIED_DOWNLOAD}" = "true" ]; then \
+ echo "WARNING: Could not download SHA512 file
(ALLOW_UNVERIFIED_DOWNLOAD=true)"; \
+ else \
+ echo "ERROR: Could not download SHA512 file"; \
+ exit 1; \
+ fi; \
+ fi; \
+ tar -xzf /tmp/hbase.tar.gz -C /opt; \
+ mv /opt/hbase-${HBASE_VERSION} ${HBASE_HOME}; \
+ rm -f /tmp/hbase.tar.gz /tmp/hbase.tar.gz.sha512 /tmp/hbase.sha512
Review Comment:
`rm -f /tmp/hbase.sha512` at the end of the RUN references a path that is
never created — the file is downloaded to `/tmp/hbase.tar.gz.sha512`. Harmless,
but should be removed to avoid confusion.
##########
docker/HBASE.md:
##########
@@ -0,0 +1,425 @@
+# HBase Backend Testing with Docker
+
+This guide explains how to start HBase locally with Docker, verify it is
working, and validate HugeGraph API operations.
+
+> **All commands in this guide should be run from the repository root** unless
otherwise noted.
+
+> **Recent path change**: The HBase compose file moved from
`docker/docker-compose.hbase.yml` to `docker/hbase/docker-compose.hbase.yml`.
If you have older shell history/scripts, update `-f` accordingly.
+
+> **Security note**: The HBase Docker build enforces SHA512 verification by
default and fails when checksum download/parsing/validation fails. Only use
`--build-arg ALLOW_UNVERIFIED_DOWNLOAD=true` for trusted test environments with
restricted networks.
+
+---
+
+## Quick Start
+
+### 0. (Optional) Clean Up Leftover HBase Tables
+```bash
+docker compose -f docker/hbase/docker-compose.hbase.yml build --no-cache hbase
+```
+
+### 1. Start HBase with Docker
+
+```bash
+docker compose -f docker/hbase/docker-compose.hbase.yml up -d
+```
+
+### 2. Wait for HBase to be Ready (~2 minutes)
+
+```bash
+# Check ZooKeeper connectivity
+nc -z localhost 2181 && echo "Ready" || echo "Not ready"
+
+# Or watch the logs
+docker compose -f docker/hbase/docker-compose.hbase.yml logs
+```
+
+### 3. (Optional) Clean Up Leftover HBase Tables
+
+For reruns, drop any leftover HugeGraph tables after the container is up:
+
+```bash
+docker exec hg-hbase-test bash -c '
+ for t in $(echo "list" | hbase shell -n 2>/dev/null | grep
"^default_hugegraph"); do
+ echo "disable '"'"'$t'"'"'; drop '"'"'$t'"'"'"
+ done | hbase shell
+'
+```
+
+Verify tables are gone before proceeding:
+
+```bash
+docker exec hg-hbase-test bash -lc "echo 'list' | hbase shell -n"
+# Expected: TABLE (empty), 0 row(s)
+```
+
+
+### 4. Configure and Init the HugeGraph Server (required for API tests)
+
+> This step is only needed for HugeGraph API sanity checks.
+
+> **Prerequisite**: Run `mvn clean package -DskipTests` from the repository
root to generate the distribution. This creates an
`apache-hugegraph-<version>/` directory with all necessary binaries and configs.
+
+Set backend to HBase in the server config:
+
+```bash
+SERVER_DIR="$(find . -maxdepth 3 -type d -path
'./apache-hugegraph-*/apache-hugegraph-server-*' | head -n 1)"
+SERVER_DIR="${SERVER_DIR#./}"
+[ -n "$SERVER_DIR" ] || { echo "HugeGraph server runtime not found. Run mvn
clean package -DskipTests first."; exit 1; }
+CONF="$SERVER_DIR/conf/graphs/hugegraph.properties"
+
+# Switch backend to hbase
+perl -pi -e 's/^backend=.*/backend=hbase/' "$CONF"
+perl -pi -e 's/^serializer=.*/serializer=hbase/' "$CONF"
+
+# Uncomment HBase connection settings
+perl -pi -e 's/^#(hbase\.hosts=.*)/$1/' "$CONF"
+perl -pi -e 's/^#(hbase\.port=.*)/$1/' "$CONF"
+perl -pi -e 's/^#(hbase\.znode_parent=.*)/$1/' "$CONF"
+```
+
+Initialize HBase tables and start the server:
+
+```bash
+printf 'pa\npa\n' | "$SERVER_DIR/bin/init-store.sh"
+"$SERVER_DIR/bin/start-hugegraph.sh" -t 60
+```
+
+After `init-store.sh`, you can verify the tables were created:
+
+```bash
+docker exec hg-hbase-test bash -lc "echo 'list' | hbase shell -n"
+```
+
+---
+
+## Docker Compose Services
+
+### HBase Container
+
+- **Image**: `hugegraph/hbase:2.6.5`
+- **Container Name**: `hg-hbase-test`
+- **Hostname**: `hbase`
+- **Ports**:
+ - `2181` - ZooKeeper (embedded)
+ - `16000` - HBase Master RPC
+ - `16010` - HBase Master Web UI (http://localhost:16010)
+ - `16020` - HBase RegionServer RPC
+ - `16030` - HBase RegionServer Web UI (http://localhost:16030)
+- **Health Check**: ZooKeeper connectivity on port 2181
+- **Startup Time**: ~90-120 seconds
+
+---
+
+## Manual Verification
+
+### 1. Check Container is Healthy
+
+```bash
+docker compose -f docker/hbase/docker-compose.hbase.yml ps
+docker logs hg-hbase-test | tail -50
+```
+
+### 2. Check ZooKeeper Connectivity
+
+```bash
+# From host machine
+nc -z localhost 2181 && echo "ZooKeeper OK" || echo "ZooKeeper not ready"
+
+# From inside the container
+docker exec hg-hbase-test nc -z localhost 2181 && echo "Ready" || echo "Not
ready"
+```
+
+### 3. Check HBase Master and RegionServer Web UIs
+
+```bash
+# HBase Master Web UI (should return HTML)
+curl -s http://localhost:16010 | head -20
+
+# RegionServer Web UI
+curl -s http://localhost:16030 | head -20
+
+# Or open in browser
+open http://localhost:16010
+```
+
+### 4. Verify HBase Tables via Shell
+
+```bash
+# List all tables (should show HugeGraph tables after init-store)
+docker exec hg-hbase-test bash -lc "echo 'list' | hbase shell -n"
+
+# Check a specific table exists (example: after backend init)
+docker exec hg-hbase-test bash -lc 'echo "describe
'"'"'default_hugegraph:g_v'"'"'" | hbase shell -n'
+```
+
+### 5. Verify HBase Logs for Errors
+
+```bash
+# Check for any ERROR lines in HBase logs
+docker exec hg-hbase-test bash -lc "grep -i error /opt/hbase/logs/*.log | tail
-20"
+
+# Tail live logs (run from repo root)
+docker compose -f docker/hbase/docker-compose.hbase.yml logs
+```
+
+> **Known benign messages** — these are safe to ignore in standalone mode:
+> - `SASL config status: Will not attempt to authenticate using SASL (unknown
error)` — ZooKeeper SASL is not configured; standalone HBase does not need it.
+> - `Invalid configuration, only one server specified (ignoring)` — expected
when running a single-node ZooKeeper.
+> - `NoClassDefFoundError: org/eclipse/jetty/...` — Jetty UI dependency
missing in the container; does not affect HBase or ZooKeeper functionality.
+
+---
+
+## Manual API Sanity (curl)
+
+These steps assume the HugeGraph server is running at `http://localhost:8080`
with auth enabled (`admin/pa`).
+
+> **Note on Idempotency**: Schema creation calls below use `"check_exist":
false`. Re-running is safe only when the submitted schema definition matches
the existing one. If definitions conflict, HugeGraph returns `ExistedException`.
Review Comment:
The "Note on Idempotency" claims schema creation calls below use
`"check_exist": false`, and describes the resulting behavior as: "Re-running is
safe only when the submitted schema definition matches the existing one. If
definitions conflict, HugeGraph returns `ExistedException`." That is the
opposite of what `check_exist=false` does in HugeGraph: it asks the server to
*skip the existence check* (and thus tolerate re-submission silently / let it
overwrite or throw on collision differently). The wording should be reviewed
against actual server behavior — as written, the doc gives the false impression
that `check_exist:false` is what triggers `ExistedException` on mismatch, which
can confuse first-time users.
##########
docker/HBASE.md:
##########
@@ -0,0 +1,425 @@
+# HBase Backend Testing with Docker
+
+This guide explains how to start HBase locally with Docker, verify it is
working, and validate HugeGraph API operations.
+
+> **All commands in this guide should be run from the repository root** unless
otherwise noted.
+
+> **Recent path change**: The HBase compose file moved from
`docker/docker-compose.hbase.yml` to `docker/hbase/docker-compose.hbase.yml`.
If you have older shell history/scripts, update `-f` accordingly.
+
+> **Security note**: The HBase Docker build enforces SHA512 verification by
default and fails when checksum download/parsing/validation fails. Only use
`--build-arg ALLOW_UNVERIFIED_DOWNLOAD=true` for trusted test environments with
restricted networks.
+
+---
+
+## Quick Start
+
+### 0. (Optional) Clean Up Leftover HBase Tables
+```bash
+docker compose -f docker/hbase/docker-compose.hbase.yml build --no-cache hbase
+```
+
+### 1. Start HBase with Docker
+
+```bash
+docker compose -f docker/hbase/docker-compose.hbase.yml up -d
+```
+
+### 2. Wait for HBase to be Ready (~2 minutes)
+
+```bash
+# Check ZooKeeper connectivity
+nc -z localhost 2181 && echo "Ready" || echo "Not ready"
+
+# Or watch the logs
+docker compose -f docker/hbase/docker-compose.hbase.yml logs
+```
+
+### 3. (Optional) Clean Up Leftover HBase Tables
+
+For reruns, drop any leftover HugeGraph tables after the container is up:
+
+```bash
+docker exec hg-hbase-test bash -c '
+ for t in $(echo "list" | hbase shell -n 2>/dev/null | grep
"^default_hugegraph"); do
+ echo "disable '"'"'$t'"'"'; drop '"'"'$t'"'"'"
+ done | hbase shell
+'
+```
+
+Verify tables are gone before proceeding:
+
+```bash
+docker exec hg-hbase-test bash -lc "echo 'list' | hbase shell -n"
+# Expected: TABLE (empty), 0 row(s)
+```
+
+
+### 4. Configure and Init the HugeGraph Server (required for API tests)
+
+> This step is only needed for HugeGraph API sanity checks.
+
+> **Prerequisite**: Run `mvn clean package -DskipTests` from the repository
root to generate the distribution. This creates an
`apache-hugegraph-<version>/` directory with all necessary binaries and configs.
+
+Set backend to HBase in the server config:
+
+```bash
+SERVER_DIR="$(find . -maxdepth 3 -type d -path
'./apache-hugegraph-*/apache-hugegraph-server-*' | head -n 1)"
+SERVER_DIR="${SERVER_DIR#./}"
+[ -n "$SERVER_DIR" ] || { echo "HugeGraph server runtime not found. Run mvn
clean package -DskipTests first."; exit 1; }
+CONF="$SERVER_DIR/conf/graphs/hugegraph.properties"
+
+# Switch backend to hbase
+perl -pi -e 's/^backend=.*/backend=hbase/' "$CONF"
+perl -pi -e 's/^serializer=.*/serializer=hbase/' "$CONF"
+
+# Uncomment HBase connection settings
+perl -pi -e 's/^#(hbase\.hosts=.*)/$1/' "$CONF"
+perl -pi -e 's/^#(hbase\.port=.*)/$1/' "$CONF"
+perl -pi -e 's/^#(hbase\.znode_parent=.*)/$1/' "$CONF"
+```
+
+Initialize HBase tables and start the server:
+
+```bash
+printf 'pa\npa\n' | "$SERVER_DIR/bin/init-store.sh"
+"$SERVER_DIR/bin/start-hugegraph.sh" -t 60
+```
+
+After `init-store.sh`, you can verify the tables were created:
+
+```bash
+docker exec hg-hbase-test bash -lc "echo 'list' | hbase shell -n"
+```
+
+---
+
+## Docker Compose Services
+
+### HBase Container
+
+- **Image**: `hugegraph/hbase:2.6.5`
+- **Container Name**: `hg-hbase-test`
+- **Hostname**: `hbase`
+- **Ports**:
+ - `2181` - ZooKeeper (embedded)
+ - `16000` - HBase Master RPC
+ - `16010` - HBase Master Web UI (http://localhost:16010)
+ - `16020` - HBase RegionServer RPC
+ - `16030` - HBase RegionServer Web UI (http://localhost:16030)
+- **Health Check**: ZooKeeper connectivity on port 2181
+- **Startup Time**: ~90-120 seconds
+
+---
+
+## Manual Verification
+
+### 1. Check Container is Healthy
+
+```bash
+docker compose -f docker/hbase/docker-compose.hbase.yml ps
+docker logs hg-hbase-test | tail -50
+```
+
+### 2. Check ZooKeeper Connectivity
+
+```bash
+# From host machine
+nc -z localhost 2181 && echo "ZooKeeper OK" || echo "ZooKeeper not ready"
+
+# From inside the container
+docker exec hg-hbase-test nc -z localhost 2181 && echo "Ready" || echo "Not
ready"
+```
+
+### 3. Check HBase Master and RegionServer Web UIs
+
+```bash
+# HBase Master Web UI (should return HTML)
+curl -s http://localhost:16010 | head -20
+
+# RegionServer Web UI
+curl -s http://localhost:16030 | head -20
+
+# Or open in browser
+open http://localhost:16010
+```
+
+### 4. Verify HBase Tables via Shell
+
+```bash
+# List all tables (should show HugeGraph tables after init-store)
+docker exec hg-hbase-test bash -lc "echo 'list' | hbase shell -n"
+
+# Check a specific table exists (example: after backend init)
+docker exec hg-hbase-test bash -lc 'echo "describe
'"'"'default_hugegraph:g_v'"'"'" | hbase shell -n'
+```
+
+### 5. Verify HBase Logs for Errors
+
+```bash
+# Check for any ERROR lines in HBase logs
+docker exec hg-hbase-test bash -lc "grep -i error /opt/hbase/logs/*.log | tail
-20"
+
+# Tail live logs (run from repo root)
+docker compose -f docker/hbase/docker-compose.hbase.yml logs
+```
+
+> **Known benign messages** — these are safe to ignore in standalone mode:
+> - `SASL config status: Will not attempt to authenticate using SASL (unknown
error)` — ZooKeeper SASL is not configured; standalone HBase does not need it.
+> - `Invalid configuration, only one server specified (ignoring)` — expected
when running a single-node ZooKeeper.
+> - `NoClassDefFoundError: org/eclipse/jetty/...` — Jetty UI dependency
missing in the container; does not affect HBase or ZooKeeper functionality.
+
+---
+
+## Manual API Sanity (curl)
+
+These steps assume the HugeGraph server is running at `http://localhost:8080`
with auth enabled (`admin/pa`).
+
+> **Note on Idempotency**: Schema creation calls below use `"check_exist":
false`. Re-running is safe only when the submitted schema definition matches
the existing one. If definitions conflict, HugeGraph returns `ExistedException`.
+>
+> **Prerequisite**: The HBase backend tables must be initialized before any
API calls will work. If you see `TableNotFoundException` errors, re-run
`init-store.sh` (see Step 0 below or the Quick Start section).
+
+### 0. Initialize Backend and Start Server
+
+> **Skip this if the server is already running.** This step is required the
first time or after a full cleanup.
+>
+> **Prerequisite**: Run `mvn clean package -DskipTests` from the repository
root first to generate the distribution.
+
+```bash
+SERVER_DIR="$(find . -maxdepth 3 -type d -path
'./apache-hugegraph-*/apache-hugegraph-server-*' | head -n 1)"
+SERVER_DIR="${SERVER_DIR#./}"
+[ -n "$SERVER_DIR" ] || { echo "HugeGraph server runtime not found. Run mvn
clean package -DskipTests first."; exit 1; }
+
+# Initialize HBase tables (enter password 'pa' when prompted)
+printf 'pa\npa\n' | "$SERVER_DIR/bin/init-store.sh"
+
+# Start the server (wait up to 60s for startup)
+"$SERVER_DIR/bin/start-hugegraph.sh" -t 60
+```
+
+Verify the server is up before continuing:
+
+### 1. Check Server is Up
+
+```bash
+curl -s http://localhost:8080/versions | python3 -m json.tool
+```
+
+### 2. List Graphs
+
+```bash
+curl -s -u admin:pa http://localhost:8080/graphspaces/DEFAULT/graphs | python3
-m json.tool
+```
+
+### 3. Create Property Keys
+
+Create multiple property keys for testing. Re-running with the same schema
returns the existing definition.
+
+```bash
+# Text property
+curl -s -u admin:pa -X POST \
+
http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/schema/propertykeys \
+ -H 'Content-Type: application/json' \
+ -d '{
+ "name": "email",
+ "data_type": "TEXT",
+ "cardinality": "SINGLE",
+ "check_exist": false
+ }' | python3 -m json.tool
+
+# Numeric property
+curl -s -u admin:pa -X POST \
+
http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/schema/propertykeys \
+ -H 'Content-Type: application/json' \
+ -d '{
+ "name": "age",
+ "data_type": "INT",
+ "cardinality": "SINGLE",
+ "check_exist": false
+ }' | python3 -m json.tool
+```
+
+### 4. Create a Vertex Label
+
+```bash
+curl -s -u admin:pa -X POST \
+
http://localhost:8080/graphspaces/DEFAULT/graphs/hugegraph/schema/vertexlabels \
+ -H 'Content-Type: application/json' \
+ -d '{
+ "name": "user",
+ "id_strategy": "PRIMARY_KEY",
+ "primary_keys": ["email"],
+ "properties": ["email", "age"],
+ "check_exist": false
+ }' | python3 -m json.tool
+```
Review Comment:
In step 2 "List Graphs" and elsewhere the doc uses the URL
`http://localhost:8080/graphspaces/DEFAULT/graphs`, which is the HugeGraph
multi-graphspace API. The default HugeGraph server in this repository (the one
produced by `mvn clean package -DskipTests` referenced earlier in this guide)
exposes the legacy single-graphspace API at
`http://localhost:8080/apis/graphs/hugegraph/...` unless graphspace support is
explicitly enabled. Following these curl commands verbatim against a
default-built server will return 404. Please verify which API surface the
documented server build actually exposes and update the URLs (or document the
required configuration to enable the `/graphspaces` endpoints).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]