Skip to content

Commit f0cd5d7

Browse files
author
Pavel Zavora
committed
chore: appease code inspections
1 parent fc3390e commit f0cd5d7

File tree

7 files changed

+11
-18
lines changed

7 files changed

+11
-18
lines changed

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,24 @@ The tool ignores missing tables and columns when importing the data.
4343
The key principles are:
4444
1. More threads are used to speed up data export/import, OOTB all (client)
4545
machine processors should be used. See `tool_concurrency` parameter in the scripts.
46-
1. The lowest transaction isolation level is used to make database export/import faster.
47-
1. Database metadata are used to export/import all user+schema tables to/from a zip file with entries
46+
2. The lowest transaction isolation level is used to make database export/import faster.
47+
3. Database metadata are used to export/import all user+schema tables to/from a zip file with entries
4848
per exported/imported table.
49-
1. Table and column names are always case-insensitive internally, error is reported when there are more tables
49+
4. Table and column names are always case-insensitive internally, error is reported when there are more tables
5050
with the same case-insensitive name.
51-
1. Concurrent execution requires an extra setup/teardown instructions during data import.
51+
5. Concurrent execution requires an extra setup/teardown instructions during data import.
5252
These vary between database types, but they always include disabling/enabling foreign
5353
key constraints, see database classes defined in the [main package](https://github.com/sranka/jdbcimage/tree/master/src/main/java/io/github/sranka/jdbcimage/main) for more details.
5454
* All triggers are disabled on Oracle before data import and then enabled after data import.
5555
* Oracle sequences, when used, are out of scope and usually have to be reset manually after data import.
5656
* All foreign key constraints are dropped by the tool on Postgress before importing the data, but a table jdbcimage_create_constraints is created with rows that are used to recreate them after data import.
5757
* Identity column sequences are reset to the lowest value after data import on Postgres.
58-
1. Streams of data are used for both export and import to have the lowest memory footprint, typically 256M of heap
58+
6. Streams of data are used for both export and import to have the lowest memory footprint, typically 256M of heap
5959
memory is good enough. BLOB, CLOBs and lengthy columns still might require more heap memory depending on data
6060
and JDBC driver in use, so you also might have to increase java heap memory and/or lower batch size used during
6161
data import. There are parameters in the scripts to do so.
62-
1. The result files are binary encoded using Kryo and zipped to be small on file system.
63-
1. The scripts accept several properties as arguments supplied as -property=value pairs
62+
7. The result files are binary encoded using Kryo and zipped to be small on file system.
63+
8. The scripts accept several properties as arguments supplied as -property=value pairs
6464
* -url=jdbc:mariadb://localhost:3306/qa - JDBC connection string
6565
* -user=user
6666
* -password=password

src/main/java/io/github/sranka/jdbcimage/ChunkedInputStream.java

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public int read() throws IOException {
6868
return retVal;
6969
}
7070

71+
@SuppressWarnings("NullableProblems")
7172
@Override
7273
public int read(byte[] b, int off, int len) throws IOException {
7374
if (finished) return -1;

src/main/java/io/github/sranka/jdbcimage/ChunkedReader.java

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public long length() {
4848
* @param count count of position to move
4949
* @return false if an end of stream was reached
5050
*/
51+
@SuppressWarnings("DuplicatedCode")
5152
private boolean forward(int count) {
5253
while (count >= (currentChunk.length - pos)) {
5354
count -= currentChunk.length - pos;
@@ -72,6 +73,7 @@ public int read() throws IOException {
7273
return retVal;
7374
}
7475

76+
@SuppressWarnings({"DuplicatedCode", "NullableProblems"})
7577
@Override
7678
public int read(char[] b, int off, int len) throws IOException {
7779
if (finished) return -1;

src/main/java/io/github/sranka/jdbcimage/ResultProducer.java

+1
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@ public interface ResultProducer {
2222
/**
2323
* Called to inform about finished processing.
2424
*/
25+
@SuppressWarnings("EmptyMethod")
2526
void close();
2627
}

src/main/java/io/github/sranka/jdbcimage/main/MariaDB.java

-5
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,4 @@ public void modifyIndexes(boolean enable) {
5656
public boolean canCreateBlobs() {
5757
return false;
5858
}
59-
60-
@Override
61-
public void importStarted() {
62-
super.importStarted();
63-
}
6459
}

src/main/java/io/github/sranka/jdbcimage/main/Oracle.java

-5
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,6 @@ public void modifyIndexes(boolean enable) throws SQLException {
198198
.collect(Collectors.toList()));
199199
}
200200

201-
@Override
202-
public void importStarted() {
203-
super.importStarted();
204-
}
205-
206201
public static class Types {
207202

208203
public static final int BINARY_DOUBLE = 101;

src/main/java/io/github/sranka/jdbcimage/main/PostgreSQL.java

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
/**
2424
* DB facade for PostgreSQL database.
2525
*/
26-
@SuppressWarnings("SpellCheckingInspection")
2726
public class PostgreSQL extends DBFacade {
2827
public static final String STATE_TABLE_NAME = "jdbcimage_create_constraints";
2928
public static final String STATE_TABLE_DDL = "CREATE TABLE " + STATE_TABLE_NAME + "( tableName varchar(64),constraintName varchar(64),sql varchar(512))";

0 commit comments

Comments
 (0)