Commit 279093bb authored by vicotor's avatar vicotor

implement new produccer

parent 86a56249
...@@ -3,6 +3,7 @@ package main ...@@ -3,6 +3,7 @@ package main
import ( import (
"github.com/IBM/sarama" "github.com/IBM/sarama"
"github.com/gogo/protobuf/proto" "github.com/gogo/protobuf/proto"
"github.com/google/uuid"
odysseus "github.com/odysseus/odysseus-protocol/gen/proto/go/base/v1" odysseus "github.com/odysseus/odysseus-protocol/gen/proto/go/base/v1"
"github.com/odysseus/scheduler/config" "github.com/odysseus/scheduler/config"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
...@@ -76,15 +77,18 @@ func produceTask() { ...@@ -76,15 +77,18 @@ func produceTask() {
func makeTask() *odysseus.TaskContent { func makeTask() *odysseus.TaskContent {
task := &odysseus.TaskContent{ task := &odysseus.TaskContent{
TaskId: "1111111", TaskId: uuid.NewString(),
TaskType: 1, TaskType: 1,
TaskKind: odysseus.TaskKind_ComputeTask, TaskKind: odysseus.TaskKind_ComputeTask,
TaskCmd: "", TaskCmd: "",
TaskParam: []byte("give me five"), TaskParam: []byte("give me five"),
TaskTimestamp: uint64(time.Now().Unix()), TaskTimestamp: uint64(time.Now().UnixNano() / 1000),
TaskCallback: "http://localhost:8080/callback", TaskCallback: "http://localhost:8080/callback",
TaskUid: "1", TaskUid: "1",
TaskFee: "10", TaskFee: "10",
TaskInLen: 10,
TaskWorkload: 100,
ContainerPubkey: []byte{},
} }
return task return task
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment