Comments (1)
Here's a quick attempt to mitigate the issue. Not sure yet whether that's good enough. It seems like it was enough for a 28M data-point batch import that was running at about 150k edits/s on average, but I'm afraid there was a bit of luck involved in that attempt (splits didn't take regions offline for very long).
diff --git a/src/tools/TextImporter.java b/src/tools/TextImporter.java
index 8fbba3b..5766bef 100644
--- a/src/tools/TextImporter.java
+++ b/src/tools/TextImporter.java
@@ -92,6 +92,7 @@ final class TextImporter {
}
static volatile boolean throttle = false;
+ static final Object throttle_condition = new Object();
private static int importFile(final HBaseClient client,
final TSDB tsdb,
@@ -109,8 +110,14 @@ final class TextImporter {
LOG.warn("Need to throttle, HBase isn't keeping up.", e);
throttle = true;
final HBaseRpc rpc = e.getFailedRpc();
- if (rpc instanceof PutRequest) {
- client.put((PutRequest) rpc); // Don't lose edits.
+ if (rpc instanceof PutRequest) { // Don't lose edits.
+ client.put((PutRequest) rpc).addCallbacks(new Callback<Object, Object>() {
+ public Object call(final Object arg) {
+ throttle = false;
+ throttle_condition.notifyAll();
+ return arg;
+ }
+ }, new Errback());
}
return null;
}
@@ -165,9 +172,11 @@ final class TextImporter {
LOG.info("Throttling...");
long throttle_time = System.nanoTime();
try {
- d.joinUninterruptibly();
- } catch (Exception e) {
- throw new RuntimeException("Should never happen", e);
+ while (throttle) {
+ throttle_condition.wait();
+ }
+ } catch (InterruptedException e) {
+ throw new RuntimeException("interrupted", e);
}
throttle_time = System.nanoTime() - throttle_time;
if (throttle_time < 1000000000L) {
@@ -175,7 +184,6 @@ final class TextImporter {
try { Thread.sleep(1000); } catch (InterruptedException e) { throw new RuntimeException("interrupted", e); }
}
LOG.info("Done throttling...");
- throttle = false;
}
}
} catch (RuntimeException e) {
from opentsdb.
Related Issues (20)
- Solving security vulnerabilities in the dependencies of opentsdb HOT 5
- Custom Retention of metrics HOT 5
- What's a way to obtain the TSUIDs in the database using the OTSBD API? HOT 1
- Feature: Jupysql integration
- Security Contact HOT 2
- Caused by: org.hbase.async.NonRecoverableException: Too many attempts HOT 2
- Where to disclose vulnerabilities HOT 3
- make check failed when opentsdb 2.4.1 test on suse15_aarch64 HOT 1
- Load uid very slowly HOT 2
- NPE on GraphHandler.java when `o` isn't specified as part of the query parameters
- ERROR [ConnectionManager.exceptionCaught] - Unexpected exception from downstream for [] java.lang.OutOfMemoryError: GC overhead limit exceeded
- how to build and run opentsdb
- 3.0 version java.lang.NoClassDefFoundError: com/google/protobuf/AbstractParser when starting tsd
- CVE-2023-25826 HOT 1
- Solving security vulnerabilities in the dependencies of opentsdb
- OpenTSDB - Unable to parse value to a number
- javax.management.loading.MLet deprecated for removal from the JDK
- Skipping exceptions in RegionClient.exceptionCaught HOT 1
- Default GUI username and password? HOT 1
- Replace AsyncHBaseClient with HBase 2 client libraries HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opentsdb.