asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "abdullah alamoudi (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: Enable Fully Qualified Class Names for Adapter Data Sources
Date Fri, 29 Apr 2016 17:06:02 GMT
abdullah alamoudi has submitted this change and it was merged.

Change subject: Enable Fully Qualified Class Names for Adapter Data Sources
......................................................................


Enable Fully Qualified Class Names for Adapter Data Sources

Change-Id: I49953d4570b828b7cecb2ec926e017d008b13ddc
Reviewed-on: https://asterix-gerrit.ics.uci.edu/837
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <hubailmor@gmail.com>
---
M asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/DatasourceFactoryProvider.java
1 file changed, 10 insertions(+), 2 deletions(-)

Approvals:
  Murtadha Hubail: Looks good to me, approved
  Jenkins: Verified



diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/DatasourceFactoryProvider.java
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/DatasourceFactoryProvider.java
index 0f24f91..0954fca 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/DatasourceFactoryProvider.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/provider/DatasourceFactoryProvider.java
@@ -74,7 +74,11 @@
                     streamSourceFactory = new TwitterFirehoseStreamFactory();
                     break;
                 default:
-                    throw new AsterixException("unknown input stream factory");
+                    try {
+                        streamSourceFactory = (IInputStreamFactory) Class.forName(streamSource).newInstance();
+                    } catch (Exception e) {
+                        throw new AsterixException("unknown input stream factory: " + streamSource,
e);
+                    }
             }
         }
         return streamSourceFactory;
@@ -109,7 +113,11 @@
             case ExternalDataConstants.STREAM_SOCKET_CLIENT:
                 return new StreamRecordReaderFactory(new SocketClientInputStreamFactory());
             default:
-                throw new AsterixException("unknown record reader factory: " + reader);
+                try {
+                    return (IRecordReaderFactory<?>) Class.forName(reader).newInstance();
+                } catch (Exception e) {
+                    throw new AsterixException("unknown record reader factory: " + reader,
e);
+                }
         }
     }
 }

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/837
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I49953d4570b828b7cecb2ec926e017d008b13ddc
Gerrit-PatchSet: 2
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: abdullah alamoudi <bamousaa@gmail.com>
Gerrit-Reviewer: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Murtadha Hubail <hubailmor@gmail.com>
Gerrit-Reviewer: abdullah alamoudi <bamousaa@gmail.com>

Mime
View raw message