Example #1
0
        public void Launch()
        {
            Context.Logger.Info("[Bolt] Launch ...");
            ApacheStorm.ctx = new BoltContext();
            IPlugin iPlugin = this._createDelegate(ApacheStorm.ctx);

            if (!(iPlugin is IBolt))
            {
                Context.Logger.Error("[Bolt] newPlugin must return IBolt!");
            }
            this._bolt = (IBolt)iPlugin;

            try
            {
                //call Prepare method.
                this._bolt.Prepare(Context.Config, Context.TopologyContext);

                while (true)
                {
                    StormTuple tuple = ApacheStorm.ReadTuple();
                    if (tuple.IsHeartBeatTuple())
                    {
                        ApacheStorm.Sync();
                    }
                    else
                    {
                        this._bolt.Execute(tuple);
                    }
                }
            }
            catch (Exception ex)
            {
                Context.Logger.Error(ex.ToString());
            }
        }
 public void BeProcessesBy(IBolt bolt)
 {
     bolt.Sync(this);
 }
Example #3
0
 public void BeProcessesBy(IBolt bolt)
 {
     throw new System.NotImplementedException();
 }
 public void BeProcessesBy(IBolt bolt)
 {
     throw new System.NotImplementedException();
 }
Example #5
0
 public void BeProcessesBy(IBolt bolt)
 {
     bolt.Process(this);
 }
        public void Launch()
        {
            Context.Logger.Info("[Bolt] Launch ...");
            ApacheStorm.ctx = new BoltContext();
            IPlugin iPlugin = this._createDelegate(ApacheStorm.ctx);
            if (!(iPlugin is IBolt))
            {
                Context.Logger.Error("[Bolt] newPlugin must return IBolt!");
            }
            this._bolt = (IBolt)iPlugin;

            try
            {
                //call Prepare method.
                this._bolt.Prepare(Context.Config, Context.TopologyContext);

                while (true)
                {
                    StormTuple tuple = ApacheStorm.ReadTuple();
                    if (tuple.IsHeartBeatTuple())
                        ApacheStorm.Sync();
                    else
                    {
                        this._bolt.Execute(tuple);
                    }
                }
            }
            catch (Exception ex)
            {
                Context.Logger.Error(ex.ToString());
            }
        }
 public void BeProcessesBy(IBolt bolt)
 {
     _processSetup.Setup(PidDir);
     bolt.Initialise(this);
 }
Example #8
0
 public BoltExcuter(IBolt bolt, IInputs input)
 {
     this.bolt   = bolt;
     this.input  = input;
     this.output = new Output();
 }
Example #9
0
 public void BeProcessesBy(IBolt bolt)
 {
     _processSetup.Setup(PidDir);
     bolt.Initialise(this);
 }