Skip to content

Commit 45c8991

Browse files
committed
[MINOR] Improve variable names
1 parent e095404 commit 45c8991

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

hudi-common/src/main/java/org/apache/hudi/common/util/ReflectionUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ public static Class<?> getClass(String clazzName) {
6161
return CLAZZ_CACHE.get(clazzName);
6262
}
6363

64-
public static <T> T loadClass(String fqcn) {
64+
public static <T> T loadClass(String className) {
6565
try {
66-
return (T) getClass(fqcn).newInstance();
66+
return (T) getClass(className).newInstance();
6767
} catch (InstantiationException | IllegalAccessException e) {
68-
throw new HoodieException("Could not load class " + fqcn, e);
68+
throw new HoodieException("Could not load class " + className, e);
6969
}
7070
}
7171

hudi-sync/hudi-sync-common/src/main/java/org/apache/hudi/sync/common/util/SyncUtilHelpers.java

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,27 @@ public class SyncUtilHelpers {
3939
* Create an instance of an implementation of {@link HoodieSyncTool} that will sync all the relevant meta information
4040
* with an external metastore such as Hive etc. to ensure Hoodie tables can be queried or read via external systems.
4141
*
42-
* @param metaSyncFQCN The class that implements the sync of the metadata.
43-
* @param props property map.
44-
* @param hadoopConfig Hadoop confs.
45-
* @param fs Filesystem used.
46-
* @param targetBasePath The target base path that contains the hoodie table.
47-
* @param baseFileFormat The file format used by the hoodie table (defaults to PARQUET).
42+
* @param syncToolClassName Class name of the {@link HoodieSyncTool} implementation.
43+
* @param props property map.
44+
* @param hadoopConfig Hadoop confs.
45+
* @param fs Filesystem used.
46+
* @param targetBasePath The target base path that contains the hoodie table.
47+
* @param baseFileFormat The file format used by the hoodie table (defaults to PARQUET).
4848
*/
49-
public static void runHoodieMetaSync(String metaSyncFQCN,
49+
public static void runHoodieMetaSync(String syncToolClassName,
5050
TypedProperties props,
5151
Configuration hadoopConfig,
5252
FileSystem fs,
5353
String targetBasePath,
5454
String baseFileFormat) {
5555
try {
56-
instantiateMetaSyncTool(metaSyncFQCN, props, hadoopConfig, fs, targetBasePath, baseFileFormat).syncHoodieTable();
56+
instantiateMetaSyncTool(syncToolClassName, props, hadoopConfig, fs, targetBasePath, baseFileFormat).syncHoodieTable();
5757
} catch (Throwable e) {
58-
throw new HoodieException("Could not sync using the meta sync class " + metaSyncFQCN, e);
58+
throw new HoodieException("Could not sync using the meta sync class " + syncToolClassName, e);
5959
}
6060
}
6161

62-
static HoodieSyncTool instantiateMetaSyncTool(String metaSyncFQCN,
62+
static HoodieSyncTool instantiateMetaSyncTool(String syncToolClassName,
6363
TypedProperties props,
6464
Configuration hadoopConfig,
6565
FileSystem fs,
@@ -70,28 +70,28 @@ static HoodieSyncTool instantiateMetaSyncTool(String metaSyncFQCN,
7070
properties.put(HoodieSyncConfig.META_SYNC_BASE_PATH.key(), targetBasePath);
7171
properties.put(HoodieSyncConfig.META_SYNC_BASE_FILE_FORMAT.key(), baseFileFormat);
7272

73-
if (ReflectionUtils.hasConstructor(metaSyncFQCN,
73+
if (ReflectionUtils.hasConstructor(syncToolClassName,
7474
new Class<?>[] {Properties.class, Configuration.class})) {
75-
return ((HoodieSyncTool) ReflectionUtils.loadClass(metaSyncFQCN,
75+
return ((HoodieSyncTool) ReflectionUtils.loadClass(syncToolClassName,
7676
new Class<?>[] {Properties.class, Configuration.class},
7777
properties, hadoopConfig));
78-
} else if (ReflectionUtils.hasConstructor(metaSyncFQCN,
78+
} else if (ReflectionUtils.hasConstructor(syncToolClassName,
7979
new Class<?>[] {Properties.class})) {
80-
return ((HoodieSyncTool) ReflectionUtils.loadClass(metaSyncFQCN,
80+
return ((HoodieSyncTool) ReflectionUtils.loadClass(syncToolClassName,
8181
new Class<?>[] {Properties.class},
8282
properties));
83-
} else if (ReflectionUtils.hasConstructor(metaSyncFQCN,
83+
} else if (ReflectionUtils.hasConstructor(syncToolClassName,
8484
new Class<?>[] {TypedProperties.class, Configuration.class, FileSystem.class})) {
85-
return ((HoodieSyncTool) ReflectionUtils.loadClass(metaSyncFQCN,
85+
return ((HoodieSyncTool) ReflectionUtils.loadClass(syncToolClassName,
8686
new Class<?>[] {TypedProperties.class, Configuration.class, FileSystem.class},
8787
properties, hadoopConfig, fs));
88-
} else if (ReflectionUtils.hasConstructor(metaSyncFQCN,
88+
} else if (ReflectionUtils.hasConstructor(syncToolClassName,
8989
new Class<?>[] {Properties.class, FileSystem.class})) {
90-
return ((HoodieSyncTool) ReflectionUtils.loadClass(metaSyncFQCN,
90+
return ((HoodieSyncTool) ReflectionUtils.loadClass(syncToolClassName,
9191
new Class<?>[] {Properties.class, FileSystem.class},
9292
properties, fs));
9393
} else {
94-
throw new HoodieException("Could not load meta sync class " + metaSyncFQCN
94+
throw new HoodieException("Could not load meta sync class " + syncToolClassName
9595
+ ": no valid constructor found.");
9696
}
9797
}

0 commit comments

Comments
 (0)