Merge branch 'develop' of http://git.yuandian.com/testdemo/dataflow into develop
Conflicts: src/main/java/com/yuandian/dataflow/controller/TaskLog.java
This commit is contained in:
commit
819325e744
|
@ -9,6 +9,8 @@ package com.yuandian.dataflow.controller;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Random;
|
||||||
|
import java.util.concurrent.ThreadLocalRandom;
|
||||||
|
|
||||||
import com.alipay.sofa.jraft.Status;
|
import com.alipay.sofa.jraft.Status;
|
||||||
import com.alipay.sofa.jraft.rpc.RpcContext;
|
import com.alipay.sofa.jraft.rpc.RpcContext;
|
||||||
|
@ -43,6 +45,8 @@ public class PacketsProcessor implements RpcProcessor<PacketsProcessor.PacketsRe
|
||||||
private ArrayList<Any> packets = new ArrayList<>();
|
private ArrayList<Any> packets = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Random rand = new Random();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleRequest(RpcContext rpcCtx, PacketsRequest request) {
|
public void handleRequest(RpcContext rpcCtx, PacketsRequest request) {
|
||||||
// StateServerFactory.getStateServer().updateFsmStateAsync(s, onCompleted);
|
// StateServerFactory.getStateServer().updateFsmStateAsync(s, onCompleted);
|
||||||
|
@ -55,7 +59,10 @@ public class PacketsProcessor implements RpcProcessor<PacketsProcessor.PacketsRe
|
||||||
// TODO: request.packets 入库,回填, 告警 等操作
|
// TODO: request.packets 入库,回填, 告警 等操作
|
||||||
|
|
||||||
|
|
||||||
|
Thread.sleep(ThreadLocalRandom .current().nextLong(100, 3000));
|
||||||
|
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
log.info(e.toString());
|
||||||
} finally { // 确保 更新 最终的任务状态给master.
|
} finally { // 确保 更新 最终的任务状态给master.
|
||||||
|
|
||||||
// 读状态 Closure<State> 里的 getValue<State>为 State的状态
|
// 读状态 Closure<State> 里的 getValue<State>为 State的状态
|
||||||
|
|
|
@ -122,7 +122,7 @@ public class MasterFactory {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
Thread.sleep(5000);
|
Thread.sleep(2000);
|
||||||
}
|
}
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
log.info("{}", e.toString());
|
log.info("{}", e.toString());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user