[checkstyle] Unify LOG form (#1092)
This commit is contained in:
@@ -51,7 +51,7 @@ import java.util.List;
|
||||
*/
|
||||
public class HoodieClientExample {
|
||||
|
||||
private static Logger logger = LogManager.getLogger(HoodieClientExample.class);
|
||||
private static final Logger LOG = LogManager.getLogger(HoodieClientExample.class);
|
||||
@Parameter(names = {"--help", "-h"}, help = true)
|
||||
public Boolean help = false;
|
||||
@Parameter(names = {"--table-path", "-p"}, description = "path for Hoodie sample table")
|
||||
@@ -103,7 +103,7 @@ public class HoodieClientExample {
|
||||
* Write 1 (only inserts)
|
||||
*/
|
||||
String newCommitTime = client.startCommit();
|
||||
logger.info("Starting commit " + newCommitTime);
|
||||
LOG.info("Starting commit " + newCommitTime);
|
||||
|
||||
List<HoodieRecord> records = dataGen.generateInserts(newCommitTime, 100);
|
||||
recordsSoFar.addAll(records);
|
||||
@@ -114,7 +114,7 @@ public class HoodieClientExample {
|
||||
* Write 2 (updates)
|
||||
*/
|
||||
newCommitTime = client.startCommit();
|
||||
logger.info("Starting commit " + newCommitTime);
|
||||
LOG.info("Starting commit " + newCommitTime);
|
||||
List<HoodieRecord> toBeUpdated = dataGen.generateUpdates(newCommitTime, 100);
|
||||
records.addAll(toBeUpdated);
|
||||
recordsSoFar.addAll(toBeUpdated);
|
||||
@@ -125,7 +125,7 @@ public class HoodieClientExample {
|
||||
* Delete 1
|
||||
*/
|
||||
newCommitTime = client.startCommit();
|
||||
logger.info("Starting commit " + newCommitTime);
|
||||
LOG.info("Starting commit " + newCommitTime);
|
||||
List<HoodieKey> toBeDeleted = HoodieClientTestUtils
|
||||
.getKeysToDelete(HoodieClientTestUtils.getHoodieKeys(recordsSoFar), 10);
|
||||
JavaRDD<HoodieKey> deleteRecords = jsc.<HoodieKey>parallelize(toBeDeleted, 1);
|
||||
|
||||
@@ -92,7 +92,7 @@ import static org.junit.Assert.assertTrue;
|
||||
public class TestCleaner extends TestHoodieClientBase {
|
||||
|
||||
private static final int BIG_BATCH_INSERT_SIZE = 500;
|
||||
private static Logger logger = LogManager.getLogger(TestHoodieClientBase.class);
|
||||
private static final Logger LOG = LogManager.getLogger(TestHoodieClientBase.class);
|
||||
|
||||
/**
|
||||
* Helper method to do first batch of insert for clean by versions/commits tests.
|
||||
@@ -393,7 +393,7 @@ public class TestCleaner extends TestHoodieClientBase {
|
||||
for (HoodieFileGroup fileGroup : fileGroups) {
|
||||
Set<String> commitTimes = new HashSet<>();
|
||||
fileGroup.getAllDataFiles().forEach(value -> {
|
||||
logger.debug("Data File - " + value);
|
||||
LOG.debug("Data File - " + value);
|
||||
commitTimes.add(value.getCommitTime());
|
||||
});
|
||||
assertEquals("Only contain acceptable versions of file should be present",
|
||||
|
||||
@@ -31,6 +31,8 @@ import org.apache.hudi.common.util.collection.Pair;
|
||||
import org.apache.hudi.exception.HoodieException;
|
||||
import org.apache.hudi.exception.HoodieIOException;
|
||||
|
||||
import org.apache.log4j.LogManager;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
@@ -48,6 +50,8 @@ import static org.apache.hudi.common.model.HoodieTableType.MERGE_ON_READ;
|
||||
|
||||
public class TestCompactionAdminClient extends TestHoodieClientBase {
|
||||
|
||||
private static final Logger LOG = LogManager.getLogger(TestCompactionAdminClient.class);
|
||||
|
||||
private HoodieTableMetaClient metaClient;
|
||||
private CompactionAdminClient client;
|
||||
|
||||
@@ -151,7 +155,7 @@ public class TestCompactionAdminClient extends TestHoodieClientBase {
|
||||
Assert.assertTrue("Rename Files must be empty", renameFiles.isEmpty());
|
||||
}
|
||||
expRenameFiles.entrySet().stream().forEach(r -> {
|
||||
logger.info("Key :" + r.getKey() + " renamed to " + r.getValue() + " rolled back to "
|
||||
LOG.info("Key :" + r.getKey() + " renamed to " + r.getValue() + " rolled back to "
|
||||
+ renameFilesFromUndo.get(r.getKey()));
|
||||
});
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ import static org.junit.Assert.assertTrue;
|
||||
*/
|
||||
public class TestHoodieClientBase extends HoodieClientTestHarness {
|
||||
|
||||
protected static Logger logger = LogManager.getLogger(TestHoodieClientBase.class);
|
||||
private static final Logger LOG = LogManager.getLogger(TestHoodieClientBase.class);
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
|
||||
@@ -47,6 +47,8 @@ import org.apache.hudi.table.HoodieTable;
|
||||
|
||||
import org.apache.avro.generic.GenericRecord;
|
||||
import org.apache.hadoop.fs.Path;
|
||||
import org.apache.log4j.LogManager;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.spark.api.java.JavaRDD;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
@@ -76,6 +78,8 @@ import static org.mockito.Mockito.when;
|
||||
@SuppressWarnings("unchecked")
|
||||
public class TestHoodieClientOnCopyOnWriteStorage extends TestHoodieClientBase {
|
||||
|
||||
private static final Logger LOG = LogManager.getLogger(TestHoodieClientOnCopyOnWriteStorage.class);
|
||||
|
||||
/**
|
||||
* Test Auto Commit behavior for HoodieWriteClient insert API.
|
||||
*/
|
||||
@@ -867,7 +871,7 @@ public class TestHoodieClientOnCopyOnWriteStorage extends TestHoodieClientBase {
|
||||
Path markerFilePath = new Path(String.format("%s/%s", partitionPath,
|
||||
FSUtils.makeMarkerFile(commitTime, "1-0-1", UUID.randomUUID().toString())));
|
||||
metaClient.getFs().create(markerFilePath);
|
||||
logger.info("Created a dummy marker path=" + markerFilePath);
|
||||
LOG.info("Created a dummy marker path=" + markerFilePath);
|
||||
|
||||
try {
|
||||
client.commit(commitTime, result);
|
||||
|
||||
@@ -48,7 +48,7 @@ import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class TestMultiFS extends HoodieClientTestHarness {
|
||||
|
||||
private static Logger logger = LogManager.getLogger(TestMultiFS.class);
|
||||
private static final Logger LOG = LogManager.getLogger(TestMultiFS.class);
|
||||
private String tablePath = "file:///tmp/hoodie/sample-table";
|
||||
protected String tableName = "hoodie_rt";
|
||||
private String tableType = HoodieTableType.COPY_ON_WRITE.name();
|
||||
@@ -92,7 +92,7 @@ public class TestMultiFS extends HoodieClientTestHarness {
|
||||
|
||||
// Write generated data to hdfs (only inserts)
|
||||
String readCommitTime = hdfsWriteClient.startCommit();
|
||||
logger.info("Starting commit " + readCommitTime);
|
||||
LOG.info("Starting commit " + readCommitTime);
|
||||
List<HoodieRecord> records = dataGen.generateInserts(readCommitTime, 100);
|
||||
JavaRDD<HoodieRecord> writeRecords = jsc.parallelize(records, 1);
|
||||
hdfsWriteClient.upsert(writeRecords, readCommitTime);
|
||||
@@ -109,13 +109,13 @@ public class TestMultiFS extends HoodieClientTestHarness {
|
||||
tableName, HoodieAvroPayload.class.getName());
|
||||
|
||||
String writeCommitTime = localWriteClient.startCommit();
|
||||
logger.info("Starting write commit " + writeCommitTime);
|
||||
LOG.info("Starting write commit " + writeCommitTime);
|
||||
List<HoodieRecord> localRecords = dataGen.generateInserts(writeCommitTime, 100);
|
||||
JavaRDD<HoodieRecord> localWriteRecords = jsc.parallelize(localRecords, 1);
|
||||
logger.info("Writing to path: " + tablePath);
|
||||
LOG.info("Writing to path: " + tablePath);
|
||||
localWriteClient.upsert(localWriteRecords, writeCommitTime);
|
||||
|
||||
logger.info("Reading from path: " + tablePath);
|
||||
LOG.info("Reading from path: " + tablePath);
|
||||
fs = FSUtils.getFs(tablePath, HoodieTestUtils.getDefaultHadoopConf());
|
||||
metaClient = new HoodieTableMetaClient(fs.getConf(), tablePath);
|
||||
timeline = new HoodieActiveTimeline(metaClient).getCommitTimeline();
|
||||
|
||||
@@ -72,7 +72,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
public class HoodieClientTestUtils {
|
||||
|
||||
private static final transient Logger LOG = LogManager.getLogger(HoodieClientTestUtils.class);
|
||||
private static final Logger LOG = LogManager.getLogger(HoodieClientTestUtils.class);
|
||||
private static final Random RANDOM = new Random();
|
||||
|
||||
public static List<WriteStatus> collectStatuses(Iterator<List<WriteStatus>> statusListItr) {
|
||||
|
||||
@@ -70,7 +70,7 @@ import static org.mockito.Mockito.when;
|
||||
|
||||
public class TestCopyOnWriteTable extends HoodieClientTestHarness {
|
||||
|
||||
protected static Logger log = LogManager.getLogger(TestCopyOnWriteTable.class);
|
||||
private static final Logger LOG = LogManager.getLogger(TestCopyOnWriteTable.class);
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
@@ -382,7 +382,7 @@ public class TestCopyOnWriteTable extends HoodieClientTestHarness {
|
||||
int counts = 0;
|
||||
for (File file : new File(basePath + "/2016/01/31").listFiles()) {
|
||||
if (file.getName().endsWith(".parquet") && FSUtils.getCommitTime(file.getName()).equals(commitTime)) {
|
||||
log.info(file.getName() + "-" + file.length());
|
||||
LOG.info(file.getName() + "-" + file.length());
|
||||
counts++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user