示例#1
0
        public void Launch()
        {
            Context.Logger.Info("[Spout] Launch ...");
            ApacheStorm.ctx = new SpoutContext();
            IPlugin iPlugin = this._createDelegate(ApacheStorm.ctx);

            if (!(iPlugin is ISpout))
            {
                Context.Logger.Error("[Spout] newPlugin must return ISpout!");
            }
            this._spout = (ISpout)iPlugin;
            //call Open method.
            this._spout.Open(Context.Config, Context.TopologyContext);

            Stopwatch stopwatch = new Stopwatch();

            while (true)
            {
                try
                {
                    stopwatch.Start();
                    Command command = ApacheStorm.ReadCommand();
                    if (command.command == "next")
                    {
                        this._spout.NextTuple();
                    }
                    else if (command.command == "ack")
                    {
                        long seqId = long.Parse(command.id);
                        this._spout.Ack(seqId);
                    }
                    else if (command.command == "fail")
                    {
                        long seqId = long.Parse(command.id);
                        this._spout.Fail(seqId);
                    }
                    else
                    {
                        Context.Logger.Error("[Spout] unexpected message.");
                    }
                    ApacheStorm.Sync();
                    stopwatch.Stop();
                }
                catch (Exception ex)
                {
                    Context.Logger.Error(ex.ToString());
                }
            }
        }
 public void BeProcessesBy(ISpout spout)
 {
     throw new System.NotImplementedException();
 }
示例#3
0
 public void BeProcessesBy(ISpout spout)
 {
     spout.Next(this);
 }
示例#4
0
 public void BeProcessesBy(ISpout spout)
 {
     spout.Fail(this);
 }
示例#5
0
 public void BeProcessesBy(ISpout spout)
 {
     throw new System.NotImplementedException();
 }
 public void BeProcessesBy(ISpout spout)
 {
     spout.Next(this);
 }
 public void BeProcessesBy(ISpout spout)
 {
     _processSetup.Setup(PidDir);
     spout.Initialise(this);
 }
        public void Launch()
        {
            Context.Logger.Info("[Spout] Launch ...");
            ApacheStorm.ctx = new SpoutContext();
            IPlugin iPlugin = this._createDelegate(ApacheStorm.ctx);
            if (!(iPlugin is ISpout))
            {
                Context.Logger.Error("[Spout] newPlugin must return ISpout!");
            }
            this._spout = (ISpout)iPlugin;
            //call Open method.
            this._spout.Open(Context.Config, Context.TopologyContext);

            Stopwatch stopwatch = new Stopwatch();
            while (true)
            {
                try
                {
                    stopwatch.Start();
                    Command command = ApacheStorm.ReadCommand();
                    if (command.Name == "next")
                    {
                        this._spout.NextTuple();
                    }
                    else if (command.Name == "ack")
                    {
                        long seqId = long.Parse(command.Id);
                        this._spout.Ack(seqId);
                    }
                    else if (command.Name == "fail")
                    {
                        long seqId = long.Parse(command.Id);
                        this._spout.Fail(seqId);
                    }
                    else
                    {
                        Context.Logger.Error("[Spout] unexpected message.");
                    }
                    ApacheStorm.Sync();
                    stopwatch.Stop();
                }
                catch (Exception ex)
                {
                    Context.Logger.Error(ex.ToString());
                }
            }
        }
 public void BeProcessesBy(ISpout spout)
 {
     spout.Acknowledge(this);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="EventPublisherService"/> class.
 /// </summary>
 public EventPublisherService(ISpout spout)
 {
     _spout = spout;
 }
 public void BeProcessesBy(ISpout spout)
 {
     spout.Fail(this);
 }
示例#12
0
 public void BeProcessesBy(ISpout spout)
 {
     spout.Acknowledge(this);
 }
示例#13
0
 public void BeProcessesBy(ISpout spout)
 {
     _processSetup.Setup(PidDir);
     spout.Initialise(this);
 }