Skip to content

Commit 011f831

Browse files
committed
Release 2022-09-14. Bandwidth enhancements.
The bandwidth command now * can save details to a CSV file * adds options to set: read policy, block size, whether to flush/hflush after each write * reports whether progress callbacks were made during (possibly slow) close() operations. Read the bandwidth documentation for details and example analysis of CSV files using different S3A tuning parameters (including prefetching).
1 parent a55ce37 commit 011f831

7 files changed

Lines changed: 480 additions & 305 deletions

File tree

BUILDING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@ With maven, with profiles for many different hadoop versions.
1919
To build a production release
2020
1. Use java8
2121
2. And compile against a shipping hadoop version, with `-Pextra` for the extra stuff
22+
3. Do not attempt to build the AWS v1 SDK components `-Pextra` against a version of Hadoop
23+
built with the AWS V2 SDK. It will fail
2224

2325

2426
```bash
25-
mvn clean install -Phadoop-3.3.2 -Pextra
27+
mvn clean install -Pextra
2628
```
2729

2830
## Releasing

README.md

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ kept out right now for various reasons
2525
Why?
2626

2727
1. Sometimes things fail, and the first problem is classpath;
28-
1. The second, invariably some client-side config.
29-
1. Then there's networking and permissions...
30-
1. The Hadoop FS connectors all assume a well configured system, and don't
28+
2. The second, invariably some client-side config.
29+
3. Then there's networking and permissions...
30+
4. The Hadoop FS connectors all assume a well configured system, and don't
3131
do much in terms of meaningful diagnostics.
32-
1. This is compounded by the fact that we dare not log secret credentials.
33-
1. And in support calls, it's all to easy to get those secrets, even
32+
5. This is compounded by the fact that we dare not log secret credentials.
33+
6. And in support calls, it's all to easy to get those secrets, even
3434
though its a major security breach to get them.
3535

3636
### Secondary: higher performance cloud IO
3737

38-
The main hadoop `hadoop fs` commands are written assuming a filesystem, where
38+
The main hadoop `hadoop fs` commands are written assuming a filesystem, where:
3939

4040
* Recursive treewalks are the way to traverse the store.
4141
* The code was written for Hadoop 1.0 and uses the filesystem APIs of that era.
@@ -133,16 +133,7 @@ The comments are printed too! This means you can use them in the reports.
133133

134134
## Command `bandwidth`
135135

136-
Measure upload/download bandwidth.
137-
138-
```bash
139-
bin/hadoop jar cloudstore-1.0.jar bandwidth
140-
Usage: bandwidth [options] size <path>
141-
-D <key=value> Define a property
142-
-tokenfile <file> Hadoop token file to load
143-
-verbose print verbose output
144-
-xmlfile <file> XML config file to load
145-
```
136+
Measure upload/download bandwidth, optionally saving data to a CSV file.
146137

147138
See [bandwidth](src/main/site/bandwidth.md) for details.
148139

src/main/java/org/apache/hadoop/fs/store/CommonParameters.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ public final class CommonParameters {
2929
/** {@value}. */
3030
public static final String XMLFILE = "xmlfile";
3131

32-
/** {@value}. */
33-
public static final String CSVFILE = "csv";
34-
3532
/** file for system properties {@value}. */
3633
public static final String SYSPROPFILE = "syspropfile";
3734

src/main/java/org/apache/hadoop/fs/store/StoreDurationInfo.java

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public class StoreDurationInfo
3838

3939
private long finished;
4040

41+
private boolean isFinished;
42+
4143
private final String text;
4244

4345
private final Logger log;
@@ -78,7 +80,7 @@ public StoreDurationInfo(PrintStream out, String format, Object... args) {
7880
}
7981
}
8082

81-
/**
83+
/**
8284
* Create the duration with no output printed.
8385
*/
8486
public StoreDurationInfo() {
@@ -93,8 +95,14 @@ private long time() {
9395
return System.currentTimeMillis();
9496
}
9597

96-
public void finished() {
97-
finished = time();
98+
/**
99+
* Finish the operation; only valid once.
100+
*/
101+
public synchronized void finished() {
102+
if (!isFinished) {
103+
finished = time();
104+
isFinished = true;
105+
}
98106
}
99107

100108
public String getDurationString() {
@@ -104,7 +112,7 @@ public String getDurationString() {
104112
public static String humanTime(long time) {
105113
long seconds = (time / 1000);
106114
long minutes = (seconds / 60);
107-
return String.format("%d:%02d:%03d", minutes, seconds % 60, time % 1000);
115+
return String.format("%d:%02d.%03d", minutes, seconds % 60, time % 1000);
108116
}
109117

110118
/**
@@ -122,11 +130,17 @@ public long value() {
122130
public Duration asDuration() {
123131
return Duration.ofMillis(value());
124132
}
133+
125134
@Override
126135
public String toString() {
127136
return getDurationString();
128137
}
129138

139+
140+
/**
141+
* Close the duration, invoke {@link #finished()}.
142+
* Log the final state if a log or output stream was provided.
143+
*/
130144
@Override
131145
public void close() {
132146
finished();

src/main/java/org/apache/hadoop/fs/store/StoreEntryPoint.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ public final void println() {
155155
/**
156156
* Print a formatted string followed by a newline to the output stream.
157157
* @param format format string
158-
* @param args optional arguments
159158
*/
160159
@Override
161160
public void println(String format) {
@@ -297,6 +296,16 @@ protected final String getOption(String opt) {
297296
return getCommandFormat().getOptValue(opt);
298297
}
299298

299+
/**
300+
* Get the value of a key-val option.
301+
* @param opt option.
302+
* @param defval default value
303+
* @return the value or null
304+
*/
305+
protected final String getOption(String opt, String defval) {
306+
return hasOption(opt) ? getCommandFormat().getOptValue(opt) : defval;
307+
}
308+
300309
/**
301310
* Did the command line have a specific option.
302311
* @param opt option.

0 commit comments

Comments
 (0)