[checkstyle] Add ConstantName java checkstyle rule (#1066)
* add SimplifyBooleanExpression java checkstyle rule * collapse empty tags in scalastyle file
This commit is contained in:
@@ -39,7 +39,7 @@ import java.io.Serializable;
|
||||
*/
|
||||
public abstract class AbstractHoodieClient implements Serializable, AutoCloseable {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(AbstractHoodieClient.class);
|
||||
private static final Logger LOG = LogManager.getLogger(AbstractHoodieClient.class);
|
||||
|
||||
protected final transient FileSystem fs;
|
||||
protected final transient JavaSparkContext jsc;
|
||||
@@ -79,7 +79,7 @@ public abstract class AbstractHoodieClient implements Serializable, AutoCloseabl
|
||||
private synchronized void stopEmbeddedServerView(boolean resetViewStorageConfig) {
|
||||
if (timelineServer.isPresent() && shouldStopTimelineServer) {
|
||||
// Stop only if owner
|
||||
logger.info("Stopping Timeline service !!");
|
||||
LOG.info("Stopping Timeline service !!");
|
||||
timelineServer.get().stop();
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ public abstract class AbstractHoodieClient implements Serializable, AutoCloseabl
|
||||
if (config.isEmbeddedTimelineServerEnabled()) {
|
||||
if (!timelineServer.isPresent()) {
|
||||
// Run Embedded Timeline Server
|
||||
logger.info("Starting Timeline service !!");
|
||||
LOG.info("Starting Timeline service !!");
|
||||
timelineServer = Option.of(new EmbeddedTimelineService(jsc.hadoopConfiguration(), jsc.getConf(),
|
||||
config.getClientSpecifiedViewStorageConfig()));
|
||||
try {
|
||||
@@ -102,14 +102,14 @@ public abstract class AbstractHoodieClient implements Serializable, AutoCloseabl
|
||||
// Allow executor to find this newly instantiated timeline service
|
||||
config.setViewStorageConfig(timelineServer.get().getRemoteFileSystemViewConfig());
|
||||
} catch (IOException e) {
|
||||
logger.warn("Unable to start timeline service. Proceeding as if embedded server is disabled", e);
|
||||
LOG.warn("Unable to start timeline service. Proceeding as if embedded server is disabled", e);
|
||||
stopEmbeddedServerView(false);
|
||||
}
|
||||
} else {
|
||||
logger.info("Timeline Server already running. Not restarting the service");
|
||||
LOG.info("Timeline Server already running. Not restarting the service");
|
||||
}
|
||||
} else {
|
||||
logger.info("Embedded Timeline Server is disabled. Not starting timeline service");
|
||||
LOG.info("Embedded Timeline Server is disabled. Not starting timeline service");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ import scala.Tuple2;
|
||||
*/
|
||||
public class HoodieReadClient<T extends HoodieRecordPayload> extends AbstractHoodieClient {
|
||||
|
||||
private static final Logger logger = LogManager.getLogger(HoodieReadClient.class);
|
||||
private static final Logger LOG = LogManager.getLogger(HoodieReadClient.class);
|
||||
|
||||
/**
|
||||
* TODO: We need to persist the index type into hoodie.properties and be able to access the index just with a simple
|
||||
|
||||
@@ -47,7 +47,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
*/
|
||||
public abstract class HoodieClientTestHarness extends HoodieCommonTestHarness implements Serializable {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(HoodieClientTestHarness.class);
|
||||
private static final Logger LOG = LoggerFactory.getLogger(HoodieClientTestHarness.class);
|
||||
|
||||
protected transient JavaSparkContext jsc = null;
|
||||
protected transient SQLContext sqlContext;
|
||||
@@ -119,13 +119,13 @@ public abstract class HoodieClientTestHarness extends HoodieCommonTestHarness im
|
||||
*/
|
||||
protected void cleanupSparkContexts() {
|
||||
if (sqlContext != null) {
|
||||
logger.info("Clearing sql context cache of spark-session used in previous test-case");
|
||||
LOG.info("Clearing sql context cache of spark-session used in previous test-case");
|
||||
sqlContext.clearCache();
|
||||
sqlContext = null;
|
||||
}
|
||||
|
||||
if (jsc != null) {
|
||||
logger.info("Closing spark context used in previous test-case");
|
||||
LOG.info("Closing spark context used in previous test-case");
|
||||
jsc.close();
|
||||
jsc.stop();
|
||||
jsc = null;
|
||||
@@ -157,7 +157,7 @@ public abstract class HoodieClientTestHarness extends HoodieCommonTestHarness im
|
||||
*/
|
||||
protected void cleanupFileSystem() throws IOException {
|
||||
if (fs != null) {
|
||||
logger.warn("Closing file-system instance used in previous test-run");
|
||||
LOG.warn("Closing file-system instance used in previous test-run");
|
||||
fs.close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 transient Logger LOG = LogManager.getLogger(HoodieClientTestUtils.class);
|
||||
private static final Random RANDOM = new Random();
|
||||
|
||||
public static List<WriteStatus> collectStatuses(Iterator<List<WriteStatus>> statusListItr) {
|
||||
@@ -166,7 +166,7 @@ public class HoodieClientTestUtils {
|
||||
try {
|
||||
HashMap<String, String> paths =
|
||||
getLatestFileIDsToFullPath(basePath, commitTimeline, Arrays.asList(commitInstant));
|
||||
log.info("Path :" + paths.values());
|
||||
LOG.info("Path :" + paths.values());
|
||||
return sqlContext.read().parquet(paths.values().toArray(new String[paths.size()]))
|
||||
.filter(String.format("%s ='%s'", HoodieRecord.COMMIT_TIME_METADATA_FIELD, commitTime));
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -46,7 +46,7 @@ import java.util.zip.InflaterInputStream;
|
||||
*/
|
||||
public class TestRawTripPayload implements HoodieRecordPayload<TestRawTripPayload> {
|
||||
|
||||
private static final transient ObjectMapper mapper = new ObjectMapper();
|
||||
private static final transient ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
||||
private String partitionPath;
|
||||
private String rowKey;
|
||||
private byte[] jsonDataCompressed;
|
||||
@@ -71,7 +71,7 @@ public class TestRawTripPayload implements HoodieRecordPayload<TestRawTripPayloa
|
||||
public TestRawTripPayload(String jsonData) throws IOException {
|
||||
this.jsonDataCompressed = compressData(jsonData);
|
||||
this.dataSize = jsonData.length();
|
||||
Map<String, Object> jsonRecordMap = mapper.readValue(jsonData, Map.class);
|
||||
Map<String, Object> jsonRecordMap = OBJECT_MAPPER.readValue(jsonData, Map.class);
|
||||
this.rowKey = jsonRecordMap.get("_row_key").toString();
|
||||
this.partitionPath = jsonRecordMap.get("time").toString().split("T")[0].replace("-", "/");
|
||||
this.isDeleted = false;
|
||||
|
||||
Reference in New Issue
Block a user