nsivabalan commented on code in PR #20151:
URL: https://github.com/apache/hudi/pull/20151#discussion_r4279813980


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/HoodieTableHealthChecker.md:
##########
@@ -0,0 +1,218 @@
+<!--
+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.
+-->
+
+# HoodieTableHealthChecker
+
+Reports whether a Hudi table's table services are keeping up with ingestion. 
Meant to be run on a
+schedule — daily is typical — against the tables you are responsible for, with 
the exit code wired
+into whatever alerts you.
+
+The tool is strictly read-only. It inspects timeline state and reports; it 
never schedules or runs
+a table service, and never writes to the table.
+
+## Quick start
+
+```bash
+spark-submit \
+  --master local \
+  --class org.apache.hudi.utilities.HoodieTableHealthChecker \
+  
$HUDI_DIR/packaging/hudi-utilities-bundle/target/hudi-utilities-bundle_2.12-1.3.0-SNAPSHOT.jar
 \
+  --base-path s3://bucket/path/to/table \
+  --props s3://bucket/path/to/writer.properties
+```
+
+The checks currently shipped are timeline-only, so no Spark session is 
actually required. Running
+it as a plain Java process works too, and is cheaper:
+
+```bash
+java -cp 
$HUDI_DIR/packaging/hudi-utilities-bundle/target/hudi-utilities-bundle_2.12-1.3.0-SNAPSHOT.jar
 \

Review Comment:
   Both done.
   
   The `java -cp` command is gone. You're right that the bundle doesn't carry 
slf4j, Hadoop or Jackson — the claim that it could run as a plain Java process 
was wrong. The text now says the checks are timeline-only so no Spark session 
is used for the work itself, but the bundle still needs the classes 
`spark-submit` puts on the classpath, so run it that way.
   
   The cron example further down had the same `java -cp` invocation and keyed 
off the old exit codes, so it would have failed twice over. It now uses 
`spark-submit` and the new codes, including an `elif` for a non-zero code that 
isn't a verdict — which is exactly the case your `NoClassDefFoundError` would 
have produced.
   
   Renamed `HoodieTableHealthChecker.md` to `README.md`. `README.md` is clearly 
the convention here (42 of them in the repo); `TimelineInspector.md` is the 
only other `ClassName.md` and it's mine too, so I'll rename that one in its own 
patch rather than leave a second instance of a convention we're moving away 
from.
   



-- 
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]

Reply via email to