예제 #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();
 }
예제 #6
0
 public void BeProcessesBy(ISpout spout)
 {
     spout.Next(this);
 }
 public void BeProcessesBy(ISpout spout)
 {
     _processSetup.Setup(PidDir);
     spout.Initialise(this);
 }
예제 #8
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.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;
 }
예제 #11
0
 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);
 }