Skip to content

Commit

Permalink
Incorporating yetus-general-check results
Browse files Browse the repository at this point in the history
  • Loading branch information
Himanshu Gwalani committed Jun 14, 2023
1 parent 883ae34 commit 44444e4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected void map(Text key, NullWritable value, Context context)

int recordIndex = Integer.parseInt(key.toString());

// <6-characters-for-region-boundary-prefix>_<15-random-characters>_<record-index-for-this-mapper-task>
// <6-characters-region-boundary-prefix>_<15-random-chars>_<record-index-for-this-mapper-task>
final String toolEventId =
String.format("%0" + Utility.SPLIT_PREFIX_LENGTH + "d", recordIndex % (splitCount + 1)) + "_"
+ EnvironmentEdgeManager.currentTime() + (1e14 + (random.nextFloat() * 9e13)) + "_"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.*;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.TableName;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
Expand Down Expand Up @@ -225,12 +227,15 @@ protected void readCommandLineParameters(Configuration conf, CommandLine line)

table = line.getOptionValue("table");

if (line.hasOption("mapper-count"))
if (line.hasOption("mapper-count")) {
mapperCount = Integer.parseInt(line.getOptionValue("mapper-count"));
if (line.hasOption("split-count"))
}
if (line.hasOption("split-count")) {
splitCount = Integer.parseInt(line.getOptionValue("split-count"));
if (line.hasOption("rows-per-mapper"))
}
if (line.hasOption("rows-per-mapper")) {
rowsPerMapper = Long.parseLong(line.getOptionValue("rows-per-mapper"));
}

deleteTableIfExist = line.hasOption("delete-if-exist");

Expand Down Expand Up @@ -289,9 +294,8 @@ protected void printUsage() {
final String commandSyntax = helpMessageCommand + " <OPTIONS> [-D<property=value>]*";
final String helpMessageSuffix = "Examples:\n" + helpMessageCommand
+ " -t TEST_TABLE -mc 10 -r 100 -sc 10\n" + helpMessageCommand
+ " -t TEST_TABLE -mc 10 -r 100 -sc 10 -d -o \"DISABLE_BACKUP=true,NORMALIZATION_ENABLED=false\"\n"
+ helpMessageCommand
+ " -t TEST_TABLE -mc 10 -r 100 -sc 10 -Dmapreduce.map.memory.mb=8192 -Dmapreduce.map.java.opts=-Xmx7782m\n";
+ " -t TEST_TABLE -mc 10 -r 100 -sc 10 -d -o \"BACKUP=false,NORMALIZATION_ENABLED=false\"\n"
+ helpMessageCommand + " -t TEST_TABLE -mc 10 -r 100 -sc 10 -Dmapreduce.map.memory.mb=8192\n";
helpFormatter.printHelp(commandSyntax, "", getOptions(), helpMessageSuffix);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ public byte[] getColumnName() {

public static final int MAX_SPLIT_COUNT = (int) Math.pow(10, SPLIT_PREFIX_LENGTH);

/**
* Private Constructor
*/
private Utility() {

}

public static void deleteTable(Admin admin, String tableName) throws IOException {
admin.disableTable(TableName.valueOf(tableName));
admin.deleteTable(TableName.valueOf(tableName));
Expand Down

0 comments on commit 44444e4

Please sign in to comment.