Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix redundant Checkstyle #1896

Merged
merged 21 commits into from
Oct 30, 2022
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
163df9f
add redundant
seagle-yuan Jun 3, 2022
db21536
Merge branch 'master' into checkstyle-redundant
seagle-yuan Jun 5, 2022
02f0207
add redundant check
seagle-yuan Jun 5, 2022
bfdf11a
merge line
seagle-yuan Jun 5, 2022
12b91c1
update alignment
seagle-yuan Jun 6, 2022
2de645d
Merge branch 'master' into checkstyle-redundant
seagle-yuan Jun 13, 2022
92a4bf0
delete duplicates check MissingSwitchDefault
seagle-yuan Jun 15, 2022
f437554
Merge branch 'apache:master' into checkstyle-redundant
seagle-yuan Jun 15, 2022
f6240a5
Merge branch 'checkstyle-redundant' of https://github.com/seagle-yuan…
seagle-yuan Jun 15, 2022
d3d7c79
update wrap line
seagle-yuan Jun 15, 2022
ff82af0
update code style
seagle-yuan Jun 17, 2022
432cc04
Merge branch 'master' into checkstyle-redundant
seagle-yuan Jul 6, 2022
74193f2
Merge branch 'apache:master' into checkstyle-redundant
seagle-yuan Jul 6, 2022
f96a617
Merge branch 'checkstyle-redundant' of https://github.com/seagle-yuan…
seagle-yuan Jul 6, 2022
765bd85
Merge branch 'apache:master' into checkstyle-redundant
seagle-yuan Aug 3, 2022
1447e1e
Merge branch 'master' into checkstyle-redundant
seagle-yuan Aug 3, 2022
341a18a
Merge branch 'checkstyle-redundant' of https://github.com/seagle-yuan…
seagle-yuan Sep 9, 2022
c1e2d4c
merge dev
seagle-yuan Oct 12, 2022
6ab5ab6
merge master
seagle-yuan Oct 12, 2022
8cda2a0
merge master
seagle-yuan Oct 12, 2022
868ee2f
Merge branch 'apache:master' into checkstyle-redundant
seagle-yuan Oct 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public boolean existsTable(String table) throws IOException {

public void createTable(String table, List<byte[]> cfs) throws IOException {
TableDescriptorBuilder tdb = TableDescriptorBuilder.newBuilder(
TableName.valueOf(this.namespace, table));
TableName.valueOf(this.namespace, table));
seagle-yuan marked this conversation as resolved.
Show resolved Hide resolved
for (byte[] cf : cfs) {
tdb.setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(cf)
.build());
Expand All @@ -231,15 +231,15 @@ public void createTable(String table, List<byte[]> cfs) throws IOException {
}
}

public void createPreSplitTable(String table, List<byte[]> cfs,
public void createPreSplitTable(String table, List<byte[]> cfs,
short numOfPartitions) throws IOException {
TableDescriptorBuilder builder = TableDescriptorBuilder.newBuilder(
TableName.valueOf(this.namespace, table));
for (byte[] cf : cfs) {
builder.setColumnFamily(ColumnFamilyDescriptorBuilder.newBuilder(cf).build());
}
byte[][] splits = new byte[numOfPartitions - 1]
[org.apache.hadoop.hbase.util.Bytes.SIZEOF_SHORT];
[org.apache.hadoop.hbase.util.Bytes.SIZEOF_SHORT];
seagle-yuan marked this conversation as resolved.
Show resolved Hide resolved
for (short split = 1; split < numOfPartitions; split++) {
splits[split - 1] = org.apache.hadoop.hbase.util.Bytes.toBytes(split);
}
Expand Down Expand Up @@ -363,8 +363,7 @@ void remove(String table, byte[] family, byte[] rowkey,
/**
* Get a record by rowkey and qualifier from a table
*/
R get(String table, byte[] family, byte[] rowkey,
byte[] qualifier);
R get(String table, byte[] family, byte[] rowkey, byte[] qualifier);

/**
* Get a record by rowkey from a table
Expand Down Expand Up @@ -484,7 +483,7 @@ private int batchSize() {
}

private void checkBatchResults(Object[] results, List<Row> rows)
throws Throwable {
throws Throwable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we keep the origin style: align 'throws' with 'Object[]'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert rows.size() == results.length;
for (int i = 0; i < results.length; i++) {
Object result = results[i];
Expand Down Expand Up @@ -553,7 +552,7 @@ public Integer commit() {
} catch (Throwable e) {
// TODO: Mark and delete committed records
throw new BackendException("Failed to commit, " +
"there may be inconsistent states for HBase", e);
"there may be inconsistent states for HBase", e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exceed 100 chars?

Copy link
Contributor

@zyxxoo zyxxoo Oct 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will fixed by #1996

}
}

Expand Down Expand Up @@ -808,7 +807,7 @@ private void dump(String table, Scan scan) throws IOException {
byte[] key = CellUtil.cloneQualifier(cell);
byte[] val = CellUtil.cloneValue(cell);
LOG.info(" {}={}", StringEncoding.format(key),
StringEncoding.format(val));
StringEncoding.format(val));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also wrap line before StringEncoding.format(key) for logic symmetry

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}
}
Expand Down