EmmyMiao87 commented on a change in pull request #754: Add persist operations 
for routine load job
URL: https://github.com/apache/incubator-doris/pull/754#discussion_r265539038
 
 

 ##########
 File path: 
fe/src/main/java/org/apache/doris/load/routineload/KafkaRoutineLoadJob.java
 ##########
 @@ -259,32 +247,32 @@ protected boolean unprotectNeedReschedule() {
     private List<Integer> getAllKafkaPartitions() {
         List<Integer> result = new ArrayList<>();
         List<PartitionInfo> partitionList = consumer.partitionsFor(
-                topic, Duration.ofSeconds(FETCH_PARTITIONS_TIMEOUT));
+                topic, Duration.ofSeconds(FETCH_PARTITIONS_TIMEOUT_SECOND));
         for (PartitionInfo partitionInfo : partitionList) {
             result.add(partitionInfo.partition());
         }
         return result;
     }
 
-    public static KafkaRoutineLoadJob fromCreateStmt(CreateRoutineLoadStmt 
stmt) throws AnalysisException,
-            LoadException {
+    public static KafkaRoutineLoadJob fromCreateStmt(CreateRoutineLoadStmt 
stmt) throws UserException {
         // check db and table
-        Database database = 
Catalog.getCurrentCatalog().getDb(stmt.getDBTableName().getDb());
-        if (database == null) {
-            throw new AnalysisException("There is no database named " + 
stmt.getDBTableName().getDb());
+        Database db = 
Catalog.getCurrentCatalog().getDb(stmt.getDBTableName().getDb());
+        if (db == null) {
+            ErrorReport.reportDdlException(ErrorCode.ERR_BAD_DB_ERROR, 
stmt.getDBTableName().getDb());
         }
-        database.readLock();
-        Table table;
+        db.readLock();
+        long tableId = -1L;
         try {
-            unprotectCheckCreate(stmt);
-            table = database.getTable(stmt.getDBTableName().getTbl());
+            unprotectedCheckMeta(db, stmt.getDBTableName().getTbl(), 
stmt.getRoutineLoadDesc());
+            tableId = db.getTable(stmt.getDBTableName().getTbl()).getId();
         } finally {
-            database.readUnlock();
+            db.readUnlock();
         }
 
         // init kafka routine load job
+        long id = Catalog.getInstance().getNextId();
 
 Review comment:
   Same as constructor

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to