use of org.apache.asterix.external.input.stream.factory.SocketServerInputStreamFactory in project asterixdb by apache.
the class DatasourceFactoryProvider method getInputStreamFactory.
public static IInputStreamFactory getInputStreamFactory(ILibraryManager libraryManager, String streamSource, Map<String, String> configuration) throws HyracksDataException {
IInputStreamFactory streamSourceFactory;
if (ExternalDataUtils.isExternal(streamSource)) {
String dataverse = ExternalDataUtils.getDataverse(configuration);
streamSourceFactory = ExternalDataUtils.createExternalInputStreamFactory(libraryManager, dataverse, streamSource);
} else {
switch(streamSource) {
case ExternalDataConstants.STREAM_LOCAL_FILESYSTEM:
streamSourceFactory = new LocalFSInputStreamFactory();
break;
case ExternalDataConstants.SOCKET:
case ExternalDataConstants.ALIAS_SOCKET_ADAPTER:
streamSourceFactory = new SocketServerInputStreamFactory();
break;
case ExternalDataConstants.STREAM_SOCKET_CLIENT:
streamSourceFactory = new SocketServerInputStreamFactory();
break;
default:
try {
streamSourceFactory = (IInputStreamFactory) Class.forName(streamSource).newInstance();
} catch (Exception e) {
throw new RuntimeDataException(ErrorCode.PROVIDER_DATASOURCE_FACTORY_UNKNOWN_INPUT_STREAM_FACTORY, e, streamSource);
}
}
}
return streamSourceFactory;
}
Aggregations