asterixdb-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xikui Wang (Code Review)" <do-not-re...@asterixdb.incubator.apache.org>
Subject Change in asterixdb[master]: [ASTERIXDB-2070][ING] Prevent start feed without connection
Date Tue, 29 Aug 2017 16:41:48 GMT
Xikui Wang has submitted this change and it was merged.

Change subject: [ASTERIXDB-2070][ING] Prevent start feed without connection
......................................................................


[ASTERIXDB-2070][ING] Prevent start feed without connection

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
1. Add connection size check for start feed statement.
2. Remove useless/unassigned variable in RSS feed.

Change-Id: Ic6715b3983ee8a0bb042ef5f34f30381c99466da
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1963
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: abdullah alamoudi <bamousaa@gmail.com>
---
M asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
M asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
M asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
M asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
M asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/RSSParser.java
5 files changed, 9 insertions(+), 5 deletions(-)

Approvals:
  abdullah alamoudi: Looks good to me, approved
  Jenkins: Verified; No violations found; ; Verified

Objections:
  Anon. E. Moose #1000171: 



diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
index e0d56a0..7ed5171 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/translator/QueryTranslator.java
@@ -2056,6 +2056,9 @@
                     metadataProvider.getMetadataTxnContext());
             List<FeedConnection> feedConnections = MetadataManager.INSTANCE
                     .getFeedConections(metadataProvider.getMetadataTxnContext(), dataverseName,
feedName);
+            if (feedConnections.isEmpty()) {
+                throw new CompilationException(ErrorCode.FEED_START_FEED_WITHOUT_CONNECTION,
feedName);
+            }
             for (FeedConnection feedConnection : feedConnections) {
                 // what if the dataset is in a different dataverse
                 String fqName = feedConnection.getDataverseName() + "." + feedConnection.getDatasetName();
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
index 433ee4c..abbcaaa 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -282,7 +282,7 @@
     <test-case FilePath="feeds">
       <compilation-unit name="drop-function-used-by-feed">
         <output-dir compare="Text">drop-function-used-by-feed</output-dir>
-        <expected-error>Function experiments.test_func0@1 is being used. It cannot
be dropped.</expected-error>
+        <expected-error>Function experiments.test_func0@1 is being used. It cannot
be dropped</expected-error>
       </compilation-unit>
     </test-case>
     <test-case FilePath="feeds">
@@ -293,7 +293,7 @@
     <test-case FilePath="feeds">
       <compilation-unit name="drop-dataverse-with-function-used-by-feed">
         <output-dir compare="Text">drop-dataverse-with-function-used-by-feed</output-dir>
-        <expected-error>Function fundv.test_func0@1 is being used. It cannot be dropped.</expected-error>
+        <expected-error>Function fundv.test_func0@1 is being used. It cannot be dropped</expected-error>
       </compilation-unit>
     </test-case>
   </test-group>
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
index fcfb428..1e32678 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
@@ -233,6 +233,7 @@
     public static final int FEED_STOPPED_WHILE_WAITING_FOR_A_NEW_RECORD = 3108;
     public static final int METADATA_DROP_FUCTION_IN_USE = 3109;
     public static final int FEED_FAILED_WHILE_GETTING_A_NEW_RECORD = 3110;
+    public static final int FEED_START_FEED_WITHOUT_CONNECTION = 3111;
 
     // Lifecycle management errors
     public static final int DUPLICATE_PARTITION_ID = 4000;
diff --git a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
index 5bd5482..fd5dba2 100644
--- a/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
+++ b/asterixdb/asterix-common/src/main/resources/asx_errormsg/en.properties
@@ -220,8 +220,9 @@
 3106 = %1$s is not registered
 3107 = Active Notification Handler is already suspended
 3108 = Feed stopped while waiting for a new record
-3109 = Function %1$s is being used. It cannot be dropped.
+3109 = Function %1$s is being used. It cannot be dropped
 3110 = Feed failed while reading a new record
+3111 = Feed %1$s is not connected to any dataset
 
 # Lifecycle management errors
 4000 = Partition id %1$d for node %2$s already in use by node %3$s
diff --git a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/RSSParser.java
b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/RSSParser.java
index b6c2221..e260083 100644
--- a/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/RSSParser.java
+++ b/asterixdb/asterix-external-data/src/main/java/org/apache/asterix/external/parser/RSSParser.java
@@ -33,7 +33,6 @@
 
 public class RSSParser implements IRecordDataParser<SyndEntry> {
     private long id = 0;
-    private String idPrefix;
     private AMutableString[] mutableFields;
     private String[] tupleFieldValues;
     private AMutableRecord mutableRecord;
@@ -51,7 +50,7 @@
     @Override
     public void parse(IRawRecord<? extends SyndEntry> record, DataOutput out) throws
HyracksDataException {
         SyndEntry entry = record.get();
-        tupleFieldValues[0] = idPrefix + ":" + id;
+        tupleFieldValues[0] = String.valueOf(id);
         tupleFieldValues[1] = entry.getTitle();
         tupleFieldValues[2] = entry.getDescription().getValue();
         tupleFieldValues[3] = entry.getLink();

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic6715b3983ee8a0bb042ef5f34f30381c99466da
Gerrit-PatchSet: 8
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Xikui Wang <xkkwww@gmail.com>
Gerrit-Reviewer: Anon. E. Moose #1000171
Gerrit-Reviewer: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Xikui Wang <xkkwww@gmail.com>
Gerrit-Reviewer: abdullah alamoudi <bamousaa@gmail.com>

Mime
View raw message