shaofengshi closed pull request #250: KYLIN-3592, reorder static and synchronized in method declaration. URL: https://github.com/apache/kylin/pull/250
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/core-common/src/main/java/org/apache/kylin/common/metrics/common/MetricsFactory.java b/core-common/src/main/java/org/apache/kylin/common/metrics/common/MetricsFactory.java index 269c7dc849..37be1b4708 100644 --- a/core-common/src/main/java/org/apache/kylin/common/metrics/common/MetricsFactory.java +++ b/core-common/src/main/java/org/apache/kylin/common/metrics/common/MetricsFactory.java @@ -36,7 +36,7 @@ /** * Initializes static Metrics instance. */ - public synchronized static void init() { + public static synchronized void init() { if (metrics == null) { Class metricsClass = MetricsFactory.class; metrics = new CodahaleMetrics(); @@ -53,7 +53,7 @@ public static Metrics getInstance() { /** * Closes and removes static Metrics instance. */ - public synchronized static void close() throws Exception { + public static synchronized void close() throws Exception { if (metrics != null) { metrics.close(); metrics = null; diff --git a/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java b/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java index 9b99d71712..c243757fca 100644 --- a/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java +++ b/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java @@ -56,13 +56,13 @@ public static DefaultScheduler getInstance() { return INSTANCE; } - public synchronized static DefaultScheduler createInstance() { + public static synchronized DefaultScheduler createInstance() { destroyInstance(); INSTANCE = new DefaultScheduler(); return INSTANCE; } - public synchronized static void destroyInstance() { + public static synchronized void destroyInstance() { DefaultScheduler tmp = INSTANCE; INSTANCE = null; if (tmp != null) { diff --git a/core-metadata/src/main/java/org/apache/kylin/dimension/DimensionEncodingFactory.java b/core-metadata/src/main/java/org/apache/kylin/dimension/DimensionEncodingFactory.java index 8f1fcd6851..27504633a0 100644 --- a/core-metadata/src/main/java/org/apache/kylin/dimension/DimensionEncodingFactory.java +++ b/core-metadata/src/main/java/org/apache/kylin/dimension/DimensionEncodingFactory.java @@ -97,7 +97,7 @@ public boolean apply(@Nullable Pair<String, Integer> input) { }); } - private synchronized static void initFactoryMap() { + private static synchronized void initFactoryMap() { if (factoryMap == null) { Map<Pair<String, Integer>, DimensionEncodingFactory> map = Maps.newConcurrentMap(); diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/DeployCoprocessorCLI.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/DeployCoprocessorCLI.java index 6cd29d2ad2..7781ca03ea 100644 --- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/DeployCoprocessorCLI.java +++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/DeployCoprocessorCLI.java @@ -411,7 +411,7 @@ public static Path getNewestCoprocessorJar(KylinConfig config, FileSystem fileSy return path; } - public synchronized static Path uploadCoprocessorJar(String localCoprocessorJar, FileSystem fileSystem, Set<String> oldJarPaths) throws IOException { + public static synchronized Path uploadCoprocessorJar(String localCoprocessorJar, FileSystem fileSystem, Set<String> oldJarPaths) throws IOException { Path uploadPath = null; File localCoprocessorFile = new File(localCoprocessorJar); ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services