MCPcopy Create free account
hub / github.com/ddf-project/DDF / get

Method get

core/src/main/java/io/ddf/DDFManager.java:247–273  ·  view source on GitHub ↗
(EngineType engineType, DataSourceDescriptor dataSourceDescriptor)

Source from the content-addressed store, hash-verified

245 }
246
247 public static DDFManager get(EngineType engineType, DataSourceDescriptor dataSourceDescriptor) throws DDFException {
248 if (engineType == null) {
249 engineType = EngineType.fromString(ConfigConstant.ENGINE_NAME_DEFAULT.toString());
250 }
251
252 String className = Config.getValue(engineType.name(), ConfigConstant.FIELD_DDF_MANAGER);
253 // if (Strings.isNullOrEmpty(className)) return null;
254 if (Strings.isNullOrEmpty(className)) {
255 throw new DDFException("ERROR: When initializaing ddfmanager, class " +
256 className + " not found");
257 }
258
259 try {
260 Class[] classType = new Class[2];
261 classType[0] = dataSourceDescriptor.getClass();
262 classType[1] = engineType.getClass();
263
264 DDFManager manager = (DDFManager) Class.forName(className).getDeclaredConstructor(classType)
265 .newInstance(dataSourceDescriptor, engineType);
266 UUID uuid = UUID.randomUUID();
267 manager.setUUID(uuid);
268 return manager;
269 } catch (Exception e) {
270
271 throw new DDFException(e);
272 }
273 }
274
275 public static DDFManager get(EngineType engineType, String uri) throws DDFException {
276 Preconditions.checkArgument(engineType != null, "Engine type cannot be null");

Callers 15

startServerMethod · 0.95
startServerMethod · 0.95
testCopyFromS3Method · 0.95
setUpMethod · 0.95
testConfusionMatrixMethod · 0.95
testRegisterMethod · 0.95
testRepresentDDFMethod · 0.95
testNewRepHandlerMethod · 0.95
testLoadConfigMethod · 0.95
testReadConfigMethod · 0.95

Calls 5

fromStringMethod · 0.95
getValueMethod · 0.95
setUUIDMethod · 0.95
newInstanceMethod · 0.80
toStringMethod · 0.45

Tested by 15

startServerMethod · 0.76
startServerMethod · 0.76
testCopyFromS3Method · 0.76
setUpMethod · 0.76
testConfusionMatrixMethod · 0.76
testRegisterMethod · 0.76
testRepresentDDFMethod · 0.76
testNewRepHandlerMethod · 0.76
testLoadConfigMethod · 0.76
testReadConfigMethod · 0.76