morningman commented on a change in pull request #313: scheduler routine load job for stream load URL: https://github.com/apache/incubator-doris/pull/313#discussion_r233690667
########## File path: fe/src/main/java/org/apache/doris/load/routineload/RoutineLoadJob.java ########## @@ -0,0 +1,120 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +package org.apache.doris.load.routineload; + +import org.apache.doris.common.io.Writable; +import org.apache.doris.thrift.TResourceInfo; + +import java.io.DataInput; +import java.io.DataOutput; +import java.io.IOException; +import java.util.List; + +public class RoutineLoadJob implements Writable { + + public enum JobState { + NEED_SCHEDULER, + RUNNING, + PAUSED, + STOPPED, + CANCELLED + } + + public enum DataSourceType { + KAFKA + } + + protected long id; + protected String name; + protected String userName; + protected long dbId; + protected long tableId; + protected String partitions; + protected String columns; + protected String where; + protected String columnSeparator; + protected int desireTaskConcurrentNum; + protected JobState state; + protected DataSourceType dataSourceType; + // max number of error data in ten thousand data + protected int maxErrorNum; + protected String progress; + // TODO(ml): error sample + + + public RoutineLoadJob() { + } + + public RoutineLoadJob(long id, String name, String userName, long dbId, long tableId, + String partitions, String columns, String where, String columnSeparator, + int desireTaskConcurrentNum, JobState state, DataSourceType dataSourceType, + int maxErrorNum, TResourceInfo resourceInfo) { + this.id = id; + this.name = name; + this.userName = userName; + this.dbId = dbId; + this.tableId = tableId; + this.partitions = partitions; + this.columns = columns; + this.where = where; + this.columnSeparator = columnSeparator; + this.desireTaskConcurrentNum = desireTaskConcurrentNum; + this.state = state; + this.dataSourceType = dataSourceType; + this.maxErrorNum = maxErrorNum; + this.resourceInfo = resourceInfo; + this.progress = ""; + } + + // thrift object + private TResourceInfo resourceInfo; + + public long getId() { + return id; + } + + public JobState getState() { + return state; + } + + public void setState(JobState state) { + this.state = state; + } + + public TResourceInfo getResourceInfo() { + return resourceInfo; + } + + public List<RoutineLoadTask> divideRoutineLoadJob(int currentConcurrentTaskNum) { + return null; + } + + public int calculateCurrentConcurrentTaskNum() { + return 0; + } + + @Override + public void write(DataOutput out) throws IOException { + // TODO(ml) + } + + @Override + public void readFields(DataInput in) throws IOException { + // TODO(ml) Review comment: Because she needs this class somewhere... ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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]
