hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [16/51] [partial] hbase-site git commit: Published site at .
Date Sun, 12 Nov 2017 15:17:08 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/abb69192/devapidocs/src-html/org/apache/hadoop/hbase/client/ResultBoundedCompletionService.QueueingFuture.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/client/ResultBoundedCompletionService.QueueingFuture.html
b/devapidocs/src-html/org/apache/hadoop/hbase/client/ResultBoundedCompletionService.QueueingFuture.html
index 2b00008..4652557 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/client/ResultBoundedCompletionService.QueueingFuture.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/client/ResultBoundedCompletionService.QueueingFuture.html
@@ -36,9 +36,9 @@
 <span class="sourceLineNo">028</span><a name="line.28"></a>
 <span class="sourceLineNo">029</span>import org.apache.commons.logging.Log;<a
name="line.29"></a>
 <span class="sourceLineNo">030</span>import org.apache.commons.logging.LogFactory;<a
name="line.30"></a>
-<span class="sourceLineNo">031</span>import org.apache.yetus.audience.InterfaceAudience;<a
name="line.31"></a>
-<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a
name="line.32"></a>
-<span class="sourceLineNo">033</span>import org.apache.htrace.Trace;<a name="line.33"></a>
+<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.trace.TraceUtil;<a
name="line.31"></a>
+<span class="sourceLineNo">032</span>import org.apache.yetus.audience.InterfaceAudience;<a
name="line.32"></a>
+<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a
name="line.33"></a>
 <span class="sourceLineNo">034</span><a name="line.34"></a>
 <span class="sourceLineNo">035</span>/**<a name="line.35"></a>
 <span class="sourceLineNo">036</span> * A completion service for the RpcRetryingCallerFactory.<a
name="line.36"></a>
@@ -176,7 +176,7 @@
 <span class="sourceLineNo">168</span><a name="line.168"></a>
 <span class="sourceLineNo">169</span>  public void submit(RetryingCallable&lt;V&gt;
task, int callTimeout, int id) {<a name="line.169"></a>
 <span class="sourceLineNo">170</span>    QueueingFuture&lt;V&gt; newFuture
= new QueueingFuture&lt;&gt;(task, callTimeout, id);<a name="line.170"></a>
-<span class="sourceLineNo">171</span>    executor.execute(Trace.wrap(newFuture));<a
name="line.171"></a>
+<span class="sourceLineNo">171</span>    executor.execute(TraceUtil.wrap(newFuture,
"ResultBoundedCompletionService.submit"));<a name="line.171"></a>
 <span class="sourceLineNo">172</span>    tasks[id] = newFuture;<a name="line.172"></a>
 <span class="sourceLineNo">173</span>  }<a name="line.173"></a>
 <span class="sourceLineNo">174</span><a name="line.174"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/abb69192/devapidocs/src-html/org/apache/hadoop/hbase/client/ResultBoundedCompletionService.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/client/ResultBoundedCompletionService.html
b/devapidocs/src-html/org/apache/hadoop/hbase/client/ResultBoundedCompletionService.html
index 2b00008..4652557 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/client/ResultBoundedCompletionService.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/client/ResultBoundedCompletionService.html
@@ -36,9 +36,9 @@
 <span class="sourceLineNo">028</span><a name="line.28"></a>
 <span class="sourceLineNo">029</span>import org.apache.commons.logging.Log;<a
name="line.29"></a>
 <span class="sourceLineNo">030</span>import org.apache.commons.logging.LogFactory;<a
name="line.30"></a>
-<span class="sourceLineNo">031</span>import org.apache.yetus.audience.InterfaceAudience;<a
name="line.31"></a>
-<span class="sourceLineNo">032</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a
name="line.32"></a>
-<span class="sourceLineNo">033</span>import org.apache.htrace.Trace;<a name="line.33"></a>
+<span class="sourceLineNo">031</span>import org.apache.hadoop.hbase.trace.TraceUtil;<a
name="line.31"></a>
+<span class="sourceLineNo">032</span>import org.apache.yetus.audience.InterfaceAudience;<a
name="line.32"></a>
+<span class="sourceLineNo">033</span>import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;<a
name="line.33"></a>
 <span class="sourceLineNo">034</span><a name="line.34"></a>
 <span class="sourceLineNo">035</span>/**<a name="line.35"></a>
 <span class="sourceLineNo">036</span> * A completion service for the RpcRetryingCallerFactory.<a
name="line.36"></a>
@@ -176,7 +176,7 @@
 <span class="sourceLineNo">168</span><a name="line.168"></a>
 <span class="sourceLineNo">169</span>  public void submit(RetryingCallable&lt;V&gt;
task, int callTimeout, int id) {<a name="line.169"></a>
 <span class="sourceLineNo">170</span>    QueueingFuture&lt;V&gt; newFuture
= new QueueingFuture&lt;&gt;(task, callTimeout, id);<a name="line.170"></a>
-<span class="sourceLineNo">171</span>    executor.execute(Trace.wrap(newFuture));<a
name="line.171"></a>
+<span class="sourceLineNo">171</span>    executor.execute(TraceUtil.wrap(newFuture,
"ResultBoundedCompletionService.submit"));<a name="line.171"></a>
 <span class="sourceLineNo">172</span>    tasks[id] = newFuture;<a name="line.172"></a>
 <span class="sourceLineNo">173</span>  }<a name="line.173"></a>
 <span class="sourceLineNo">174</span><a name="line.174"></a>

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/abb69192/devapidocs/src-html/org/apache/hadoop/hbase/executor/EventHandler.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/executor/EventHandler.html b/devapidocs/src-html/org/apache/hadoop/hbase/executor/EventHandler.html
index 11bc137..abccb29 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/executor/EventHandler.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/executor/EventHandler.html
@@ -31,174 +31,172 @@
 <span class="sourceLineNo">023</span><a name="line.23"></a>
 <span class="sourceLineNo">024</span>import org.apache.commons.logging.Log;<a
name="line.24"></a>
 <span class="sourceLineNo">025</span>import org.apache.commons.logging.LogFactory;<a
name="line.25"></a>
-<span class="sourceLineNo">026</span>import org.apache.yetus.audience.InterfaceAudience;<a
name="line.26"></a>
-<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.Server;<a
name="line.27"></a>
-<span class="sourceLineNo">028</span>import org.apache.htrace.Span;<a name="line.28"></a>
-<span class="sourceLineNo">029</span>import org.apache.htrace.Trace;<a name="line.29"></a>
-<span class="sourceLineNo">030</span>import org.apache.htrace.TraceScope;<a
name="line.30"></a>
-<span class="sourceLineNo">031</span><a name="line.31"></a>
-<span class="sourceLineNo">032</span>/**<a name="line.32"></a>
-<span class="sourceLineNo">033</span> * Abstract base class for all HBase event
handlers. Subclasses should<a name="line.33"></a>
-<span class="sourceLineNo">034</span> * implement the {@link #process()} and
{@link #prepare()} methods.  Subclasses<a name="line.34"></a>
-<span class="sourceLineNo">035</span> * should also do all necessary checks up
in their prepare() if possible -- check<a name="line.35"></a>
-<span class="sourceLineNo">036</span> * table exists, is disabled, etc. -- so
they fail fast rather than later when process<a name="line.36"></a>
-<span class="sourceLineNo">037</span> * is running.  Do it this way because process
be invoked directly but event<a name="line.37"></a>
-<span class="sourceLineNo">038</span> * handlers are also<a name="line.38"></a>
-<span class="sourceLineNo">039</span> * run in an executor context -- i.e. asynchronously
-- and in this case,<a name="line.39"></a>
-<span class="sourceLineNo">040</span> * exceptions thrown at process time will
not be seen by the invoker, not till<a name="line.40"></a>
-<span class="sourceLineNo">041</span> * we implement a call-back mechanism so
the client can pick them up later.<a name="line.41"></a>
-<span class="sourceLineNo">042</span> * &lt;p&gt;<a name="line.42"></a>
-<span class="sourceLineNo">043</span> * Event handlers have an {@link EventType}.<a
name="line.43"></a>
-<span class="sourceLineNo">044</span> * {@link EventType} is a list of ALL handler
event types.  We need to keep<a name="line.44"></a>
-<span class="sourceLineNo">045</span> * a full list in one place -- and as enums
is a good shorthand for an<a name="line.45"></a>
-<span class="sourceLineNo">046</span> * implemenations -- because event handlers
can be passed to executors when<a name="line.46"></a>
-<span class="sourceLineNo">047</span> * they are to be run asynchronously. The<a
name="line.47"></a>
-<span class="sourceLineNo">048</span> * hbase executor, see ExecutorService,
has a switch for passing<a name="line.48"></a>
-<span class="sourceLineNo">049</span> * event type to executor.<a name="line.49"></a>
-<span class="sourceLineNo">050</span> * &lt;p&gt;<a name="line.50"></a>
-<span class="sourceLineNo">051</span> * @see ExecutorService<a name="line.51"></a>
-<span class="sourceLineNo">052</span> */<a name="line.52"></a>
-<span class="sourceLineNo">053</span>@InterfaceAudience.Private<a name="line.53"></a>
-<span class="sourceLineNo">054</span>public abstract class EventHandler implements
Runnable, Comparable&lt;Runnable&gt; {<a name="line.54"></a>
-<span class="sourceLineNo">055</span>  private static final Log LOG = LogFactory.getLog(EventHandler.class);<a
name="line.55"></a>
-<span class="sourceLineNo">056</span><a name="line.56"></a>
-<span class="sourceLineNo">057</span>  // type of event this object represents<a
name="line.57"></a>
-<span class="sourceLineNo">058</span>  protected EventType eventType;<a name="line.58"></a>
-<span class="sourceLineNo">059</span><a name="line.59"></a>
-<span class="sourceLineNo">060</span>  protected Server server;<a name="line.60"></a>
-<span class="sourceLineNo">061</span><a name="line.61"></a>
-<span class="sourceLineNo">062</span>  // sequence id generator for default FIFO
ordering of events<a name="line.62"></a>
-<span class="sourceLineNo">063</span>  protected static final AtomicLong seqids
= new AtomicLong(0);<a name="line.63"></a>
-<span class="sourceLineNo">064</span><a name="line.64"></a>
-<span class="sourceLineNo">065</span>  // sequence id for this event<a name="line.65"></a>
-<span class="sourceLineNo">066</span>  private final long seqid;<a name="line.66"></a>
-<span class="sourceLineNo">067</span><a name="line.67"></a>
-<span class="sourceLineNo">068</span>  // Time to wait for events to happen,
should be kept short<a name="line.68"></a>
-<span class="sourceLineNo">069</span>  protected int waitingTimeForEvents;<a
name="line.69"></a>
-<span class="sourceLineNo">070</span><a name="line.70"></a>
-<span class="sourceLineNo">071</span>  private final Span parent;<a name="line.71"></a>
-<span class="sourceLineNo">072</span><a name="line.72"></a>
-<span class="sourceLineNo">073</span>  /**<a name="line.73"></a>
-<span class="sourceLineNo">074</span>   * Default base class constructor.<a
name="line.74"></a>
-<span class="sourceLineNo">075</span>   */<a name="line.75"></a>
-<span class="sourceLineNo">076</span>  public EventHandler(Server server, EventType
eventType) {<a name="line.76"></a>
-<span class="sourceLineNo">077</span>    this.parent = Trace.currentSpan();<a
name="line.77"></a>
-<span class="sourceLineNo">078</span>    this.server = server;<a name="line.78"></a>
-<span class="sourceLineNo">079</span>    this.eventType = eventType;<a name="line.79"></a>
-<span class="sourceLineNo">080</span>    seqid = seqids.incrementAndGet();<a
name="line.80"></a>
-<span class="sourceLineNo">081</span>    if (server != null) {<a name="line.81"></a>
-<span class="sourceLineNo">082</span>      this.waitingTimeForEvents = server.getConfiguration().<a
name="line.82"></a>
-<span class="sourceLineNo">083</span>          getInt("hbase.master.event.waiting.time",
1000);<a name="line.83"></a>
-<span class="sourceLineNo">084</span>    }<a name="line.84"></a>
-<span class="sourceLineNo">085</span>  }<a name="line.85"></a>
-<span class="sourceLineNo">086</span><a name="line.86"></a>
-<span class="sourceLineNo">087</span>  /**<a name="line.87"></a>
-<span class="sourceLineNo">088</span>   * Event handlers should do all the necessary
checks in this method (rather than<a name="line.88"></a>
-<span class="sourceLineNo">089</span>   * in the constructor, or in process())
so that the caller, which is mostly executed<a name="line.89"></a>
-<span class="sourceLineNo">090</span>   * in the ipc context can fail fast. Process
is executed async from the client ipc,<a name="line.90"></a>
-<span class="sourceLineNo">091</span>   * so this method gives a quick chance
to do some basic checks.<a name="line.91"></a>
-<span class="sourceLineNo">092</span>   * Should be called after constructing
the EventHandler, and before process().<a name="line.92"></a>
-<span class="sourceLineNo">093</span>   * @return the instance of this class<a
name="line.93"></a>
-<span class="sourceLineNo">094</span>   * @throws Exception when something goes
wrong<a name="line.94"></a>
-<span class="sourceLineNo">095</span>   */<a name="line.95"></a>
-<span class="sourceLineNo">096</span>  public EventHandler prepare() throws Exception
{<a name="line.96"></a>
-<span class="sourceLineNo">097</span>    return this;<a name="line.97"></a>
-<span class="sourceLineNo">098</span>  }<a name="line.98"></a>
-<span class="sourceLineNo">099</span><a name="line.99"></a>
-<span class="sourceLineNo">100</span>  @Override<a name="line.100"></a>
-<span class="sourceLineNo">101</span>  public void run() {<a name="line.101"></a>
-<span class="sourceLineNo">102</span>    TraceScope chunk = Trace.startSpan(this.getClass().getSimpleName(),
parent);<a name="line.102"></a>
-<span class="sourceLineNo">103</span>    try {<a name="line.103"></a>
+<span class="sourceLineNo">026</span>import org.apache.hadoop.hbase.Server;<a
name="line.26"></a>
+<span class="sourceLineNo">027</span>import org.apache.hadoop.hbase.trace.TraceUtil;<a
name="line.27"></a>
+<span class="sourceLineNo">028</span>import org.apache.htrace.core.Span;<a
name="line.28"></a>
+<span class="sourceLineNo">029</span>import org.apache.htrace.core.TraceScope;<a
name="line.29"></a>
+<span class="sourceLineNo">030</span>import org.apache.htrace.core.Tracer;<a
name="line.30"></a>
+<span class="sourceLineNo">031</span>import org.apache.yetus.audience.InterfaceAudience;<a
name="line.31"></a>
+<span class="sourceLineNo">032</span><a name="line.32"></a>
+<span class="sourceLineNo">033</span>/**<a name="line.33"></a>
+<span class="sourceLineNo">034</span> * Abstract base class for all HBase event
handlers. Subclasses should<a name="line.34"></a>
+<span class="sourceLineNo">035</span> * implement the {@link #process()} and
{@link #prepare()} methods.  Subclasses<a name="line.35"></a>
+<span class="sourceLineNo">036</span> * should also do all necessary checks up
in their prepare() if possible -- check<a name="line.36"></a>
+<span class="sourceLineNo">037</span> * table exists, is disabled, etc. -- so
they fail fast rather than later when process<a name="line.37"></a>
+<span class="sourceLineNo">038</span> * is running.  Do it this way because process
be invoked directly but event<a name="line.38"></a>
+<span class="sourceLineNo">039</span> * handlers are also<a name="line.39"></a>
+<span class="sourceLineNo">040</span> * run in an executor context -- i.e. asynchronously
-- and in this case,<a name="line.40"></a>
+<span class="sourceLineNo">041</span> * exceptions thrown at process time will
not be seen by the invoker, not till<a name="line.41"></a>
+<span class="sourceLineNo">042</span> * we implement a call-back mechanism so
the client can pick them up later.<a name="line.42"></a>
+<span class="sourceLineNo">043</span> * &lt;p&gt;<a name="line.43"></a>
+<span class="sourceLineNo">044</span> * Event handlers have an {@link EventType}.<a
name="line.44"></a>
+<span class="sourceLineNo">045</span> * {@link EventType} is a list of ALL handler
event types.  We need to keep<a name="line.45"></a>
+<span class="sourceLineNo">046</span> * a full list in one place -- and as enums
is a good shorthand for an<a name="line.46"></a>
+<span class="sourceLineNo">047</span> * implemenations -- because event handlers
can be passed to executors when<a name="line.47"></a>
+<span class="sourceLineNo">048</span> * they are to be run asynchronously. The<a
name="line.48"></a>
+<span class="sourceLineNo">049</span> * hbase executor, see ExecutorService,
has a switch for passing<a name="line.49"></a>
+<span class="sourceLineNo">050</span> * event type to executor.<a name="line.50"></a>
+<span class="sourceLineNo">051</span> * &lt;p&gt;<a name="line.51"></a>
+<span class="sourceLineNo">052</span> * @see ExecutorService<a name="line.52"></a>
+<span class="sourceLineNo">053</span> */<a name="line.53"></a>
+<span class="sourceLineNo">054</span>@InterfaceAudience.Private<a name="line.54"></a>
+<span class="sourceLineNo">055</span>public abstract class EventHandler implements
Runnable, Comparable&lt;Runnable&gt; {<a name="line.55"></a>
+<span class="sourceLineNo">056</span>  private static final Log LOG = LogFactory.getLog(EventHandler.class);<a
name="line.56"></a>
+<span class="sourceLineNo">057</span><a name="line.57"></a>
+<span class="sourceLineNo">058</span>  // type of event this object represents<a
name="line.58"></a>
+<span class="sourceLineNo">059</span>  protected EventType eventType;<a name="line.59"></a>
+<span class="sourceLineNo">060</span><a name="line.60"></a>
+<span class="sourceLineNo">061</span>  protected Server server;<a name="line.61"></a>
+<span class="sourceLineNo">062</span><a name="line.62"></a>
+<span class="sourceLineNo">063</span>  // sequence id generator for default FIFO
ordering of events<a name="line.63"></a>
+<span class="sourceLineNo">064</span>  protected static final AtomicLong seqids
= new AtomicLong(0);<a name="line.64"></a>
+<span class="sourceLineNo">065</span><a name="line.65"></a>
+<span class="sourceLineNo">066</span>  // sequence id for this event<a name="line.66"></a>
+<span class="sourceLineNo">067</span>  private final long seqid;<a name="line.67"></a>
+<span class="sourceLineNo">068</span><a name="line.68"></a>
+<span class="sourceLineNo">069</span>  // Time to wait for events to happen,
should be kept short<a name="line.69"></a>
+<span class="sourceLineNo">070</span>  protected int waitingTimeForEvents;<a
name="line.70"></a>
+<span class="sourceLineNo">071</span><a name="line.71"></a>
+<span class="sourceLineNo">072</span>  private final Span parent;<a name="line.72"></a>
+<span class="sourceLineNo">073</span><a name="line.73"></a>
+<span class="sourceLineNo">074</span>  /**<a name="line.74"></a>
+<span class="sourceLineNo">075</span>   * Default base class constructor.<a
name="line.75"></a>
+<span class="sourceLineNo">076</span>   */<a name="line.76"></a>
+<span class="sourceLineNo">077</span>  public EventHandler(Server server, EventType
eventType) {<a name="line.77"></a>
+<span class="sourceLineNo">078</span>    this.parent = Tracer.getCurrentSpan();<a
name="line.78"></a>
+<span class="sourceLineNo">079</span>    this.server = server;<a name="line.79"></a>
+<span class="sourceLineNo">080</span>    this.eventType = eventType;<a name="line.80"></a>
+<span class="sourceLineNo">081</span>    seqid = seqids.incrementAndGet();<a
name="line.81"></a>
+<span class="sourceLineNo">082</span>    if (server != null) {<a name="line.82"></a>
+<span class="sourceLineNo">083</span>      this.waitingTimeForEvents = server.getConfiguration().<a
name="line.83"></a>
+<span class="sourceLineNo">084</span>          getInt("hbase.master.event.waiting.time",
1000);<a name="line.84"></a>
+<span class="sourceLineNo">085</span>    }<a name="line.85"></a>
+<span class="sourceLineNo">086</span>  }<a name="line.86"></a>
+<span class="sourceLineNo">087</span><a name="line.87"></a>
+<span class="sourceLineNo">088</span>  /**<a name="line.88"></a>
+<span class="sourceLineNo">089</span>   * Event handlers should do all the necessary
checks in this method (rather than<a name="line.89"></a>
+<span class="sourceLineNo">090</span>   * in the constructor, or in process())
so that the caller, which is mostly executed<a name="line.90"></a>
+<span class="sourceLineNo">091</span>   * in the ipc context can fail fast. Process
is executed async from the client ipc,<a name="line.91"></a>
+<span class="sourceLineNo">092</span>   * so this method gives a quick chance
to do some basic checks.<a name="line.92"></a>
+<span class="sourceLineNo">093</span>   * Should be called after constructing
the EventHandler, and before process().<a name="line.93"></a>
+<span class="sourceLineNo">094</span>   * @return the instance of this class<a
name="line.94"></a>
+<span class="sourceLineNo">095</span>   * @throws Exception when something goes
wrong<a name="line.95"></a>
+<span class="sourceLineNo">096</span>   */<a name="line.96"></a>
+<span class="sourceLineNo">097</span>  public EventHandler prepare() throws Exception
{<a name="line.97"></a>
+<span class="sourceLineNo">098</span>    return this;<a name="line.98"></a>
+<span class="sourceLineNo">099</span>  }<a name="line.99"></a>
+<span class="sourceLineNo">100</span><a name="line.100"></a>
+<span class="sourceLineNo">101</span>  @Override<a name="line.101"></a>
+<span class="sourceLineNo">102</span>  public void run() {<a name="line.102"></a>
+<span class="sourceLineNo">103</span>    try (TraceScope scope = TraceUtil.createTrace(this.getClass().getSimpleName(),
parent)) {<a name="line.103"></a>
 <span class="sourceLineNo">104</span>      process();<a name="line.104"></a>
 <span class="sourceLineNo">105</span>    } catch(Throwable t) {<a name="line.105"></a>
 <span class="sourceLineNo">106</span>      handleException(t);<a name="line.106"></a>
-<span class="sourceLineNo">107</span>    } finally {<a name="line.107"></a>
-<span class="sourceLineNo">108</span>      chunk.close();<a name="line.108"></a>
-<span class="sourceLineNo">109</span>    }<a name="line.109"></a>
-<span class="sourceLineNo">110</span>  }<a name="line.110"></a>
-<span class="sourceLineNo">111</span><a name="line.111"></a>
-<span class="sourceLineNo">112</span>  /**<a name="line.112"></a>
-<span class="sourceLineNo">113</span>   * This method is the main processing
loop to be implemented by the various<a name="line.113"></a>
-<span class="sourceLineNo">114</span>   * subclasses.<a name="line.114"></a>
-<span class="sourceLineNo">115</span>   * @throws IOException<a name="line.115"></a>
-<span class="sourceLineNo">116</span>   */<a name="line.116"></a>
-<span class="sourceLineNo">117</span>  public abstract void process() throws
IOException;<a name="line.117"></a>
-<span class="sourceLineNo">118</span><a name="line.118"></a>
-<span class="sourceLineNo">119</span>  /**<a name="line.119"></a>
-<span class="sourceLineNo">120</span>   * Return the event type<a name="line.120"></a>
-<span class="sourceLineNo">121</span>   * @return The event type.<a name="line.121"></a>
-<span class="sourceLineNo">122</span>   */<a name="line.122"></a>
-<span class="sourceLineNo">123</span>  public EventType getEventType() {<a
name="line.123"></a>
-<span class="sourceLineNo">124</span>    return this.eventType;<a name="line.124"></a>
-<span class="sourceLineNo">125</span>  }<a name="line.125"></a>
-<span class="sourceLineNo">126</span><a name="line.126"></a>
-<span class="sourceLineNo">127</span>  /**<a name="line.127"></a>
-<span class="sourceLineNo">128</span>   * Get the priority level for this handler
instance.  This uses natural<a name="line.128"></a>
-<span class="sourceLineNo">129</span>   * ordering so lower numbers are higher
priority.<a name="line.129"></a>
+<span class="sourceLineNo">107</span>    }<a name="line.107"></a>
+<span class="sourceLineNo">108</span>  }<a name="line.108"></a>
+<span class="sourceLineNo">109</span><a name="line.109"></a>
+<span class="sourceLineNo">110</span>  /**<a name="line.110"></a>
+<span class="sourceLineNo">111</span>   * This method is the main processing
loop to be implemented by the various<a name="line.111"></a>
+<span class="sourceLineNo">112</span>   * subclasses.<a name="line.112"></a>
+<span class="sourceLineNo">113</span>   * @throws IOException<a name="line.113"></a>
+<span class="sourceLineNo">114</span>   */<a name="line.114"></a>
+<span class="sourceLineNo">115</span>  public abstract void process() throws
IOException;<a name="line.115"></a>
+<span class="sourceLineNo">116</span><a name="line.116"></a>
+<span class="sourceLineNo">117</span>  /**<a name="line.117"></a>
+<span class="sourceLineNo">118</span>   * Return the event type<a name="line.118"></a>
+<span class="sourceLineNo">119</span>   * @return The event type.<a name="line.119"></a>
+<span class="sourceLineNo">120</span>   */<a name="line.120"></a>
+<span class="sourceLineNo">121</span>  public EventType getEventType() {<a
name="line.121"></a>
+<span class="sourceLineNo">122</span>    return this.eventType;<a name="line.122"></a>
+<span class="sourceLineNo">123</span>  }<a name="line.123"></a>
+<span class="sourceLineNo">124</span><a name="line.124"></a>
+<span class="sourceLineNo">125</span>  /**<a name="line.125"></a>
+<span class="sourceLineNo">126</span>   * Get the priority level for this handler
instance.  This uses natural<a name="line.126"></a>
+<span class="sourceLineNo">127</span>   * ordering so lower numbers are higher
priority.<a name="line.127"></a>
+<span class="sourceLineNo">128</span>   * &lt;p&gt;<a name="line.128"></a>
+<span class="sourceLineNo">129</span>   * Lowest priority is Integer.MAX_VALUE.
 Highest priority is 0.<a name="line.129"></a>
 <span class="sourceLineNo">130</span>   * &lt;p&gt;<a name="line.130"></a>
-<span class="sourceLineNo">131</span>   * Lowest priority is Integer.MAX_VALUE.
 Highest priority is 0.<a name="line.131"></a>
+<span class="sourceLineNo">131</span>   * Subclasses should override this method
to allow prioritizing handlers.<a name="line.131"></a>
 <span class="sourceLineNo">132</span>   * &lt;p&gt;<a name="line.132"></a>
-<span class="sourceLineNo">133</span>   * Subclasses should override this method
to allow prioritizing handlers.<a name="line.133"></a>
+<span class="sourceLineNo">133</span>   * Handlers with the same priority are
handled in FIFO order.<a name="line.133"></a>
 <span class="sourceLineNo">134</span>   * &lt;p&gt;<a name="line.134"></a>
-<span class="sourceLineNo">135</span>   * Handlers with the same priority are
handled in FIFO order.<a name="line.135"></a>
-<span class="sourceLineNo">136</span>   * &lt;p&gt;<a name="line.136"></a>
-<span class="sourceLineNo">137</span>   * @return Integer.MAX_VALUE by default,
override to set higher priorities<a name="line.137"></a>
-<span class="sourceLineNo">138</span>   */<a name="line.138"></a>
-<span class="sourceLineNo">139</span>  public int getPriority() {<a name="line.139"></a>
-<span class="sourceLineNo">140</span>    return Integer.MAX_VALUE;<a name="line.140"></a>
-<span class="sourceLineNo">141</span>  }<a name="line.141"></a>
-<span class="sourceLineNo">142</span><a name="line.142"></a>
-<span class="sourceLineNo">143</span>  /**<a name="line.143"></a>
-<span class="sourceLineNo">144</span>   * @return This events' sequence id.<a
name="line.144"></a>
-<span class="sourceLineNo">145</span>   */<a name="line.145"></a>
-<span class="sourceLineNo">146</span>  public long getSeqid() {<a name="line.146"></a>
-<span class="sourceLineNo">147</span>    return this.seqid;<a name="line.147"></a>
-<span class="sourceLineNo">148</span>  }<a name="line.148"></a>
-<span class="sourceLineNo">149</span><a name="line.149"></a>
-<span class="sourceLineNo">150</span>  /**<a name="line.150"></a>
-<span class="sourceLineNo">151</span>   * Default prioritized runnable comparator
which implements a FIFO ordering.<a name="line.151"></a>
-<span class="sourceLineNo">152</span>   * &lt;p&gt;<a name="line.152"></a>
-<span class="sourceLineNo">153</span>   * Subclasses should not override this.
 Instead, if they want to implement<a name="line.153"></a>
-<span class="sourceLineNo">154</span>   * priority beyond FIFO, they should override
{@link #getPriority()}.<a name="line.154"></a>
-<span class="sourceLineNo">155</span>   */<a name="line.155"></a>
-<span class="sourceLineNo">156</span>  @Override<a name="line.156"></a>
-<span class="sourceLineNo">157</span>  public int compareTo(Runnable o) {<a
name="line.157"></a>
-<span class="sourceLineNo">158</span>    EventHandler eh = (EventHandler)o;<a
name="line.158"></a>
-<span class="sourceLineNo">159</span>    if(getPriority() != eh.getPriority())
{<a name="line.159"></a>
-<span class="sourceLineNo">160</span>      return (getPriority() &lt; eh.getPriority())
? -1 : 1;<a name="line.160"></a>
-<span class="sourceLineNo">161</span>    }<a name="line.161"></a>
-<span class="sourceLineNo">162</span>    return (this.seqid &lt; eh.seqid)
? -1 : 1;<a name="line.162"></a>
-<span class="sourceLineNo">163</span>  }<a name="line.163"></a>
-<span class="sourceLineNo">164</span><a name="line.164"></a>
-<span class="sourceLineNo">165</span>  @Override<a name="line.165"></a>
-<span class="sourceLineNo">166</span>  public String toString() {<a name="line.166"></a>
-<span class="sourceLineNo">167</span>    return "Event #" + getSeqid() +<a
name="line.167"></a>
-<span class="sourceLineNo">168</span>      " of type " + eventType +<a name="line.168"></a>
-<span class="sourceLineNo">169</span>      " (" + getInformativeName() + ")";<a
name="line.169"></a>
-<span class="sourceLineNo">170</span>  }<a name="line.170"></a>
-<span class="sourceLineNo">171</span><a name="line.171"></a>
-<span class="sourceLineNo">172</span>  /**<a name="line.172"></a>
-<span class="sourceLineNo">173</span>   * Event implementations should override
thie class to provide an<a name="line.173"></a>
-<span class="sourceLineNo">174</span>   * informative name about what event they
are handling. For example,<a name="line.174"></a>
-<span class="sourceLineNo">175</span>   * event-specific information such as
which region or server is<a name="line.175"></a>
-<span class="sourceLineNo">176</span>   * being processed should be included
if possible.<a name="line.176"></a>
-<span class="sourceLineNo">177</span>   */<a name="line.177"></a>
-<span class="sourceLineNo">178</span>  public String getInformativeName() {<a
name="line.178"></a>
-<span class="sourceLineNo">179</span>    return this.getClass().toString();<a
name="line.179"></a>
-<span class="sourceLineNo">180</span>  }<a name="line.180"></a>
-<span class="sourceLineNo">181</span><a name="line.181"></a>
-<span class="sourceLineNo">182</span>  /**<a name="line.182"></a>
-<span class="sourceLineNo">183</span>   * Event exception handler, may be overridden<a
name="line.183"></a>
-<span class="sourceLineNo">184</span>   * @param t Throwable object<a name="line.184"></a>
-<span class="sourceLineNo">185</span>   */<a name="line.185"></a>
-<span class="sourceLineNo">186</span>  protected void handleException(Throwable
t) {<a name="line.186"></a>
-<span class="sourceLineNo">187</span>    String msg = "Caught throwable while
processing event " + eventType;<a name="line.187"></a>
-<span class="sourceLineNo">188</span>    LOG.error(msg, t);<a name="line.188"></a>
-<span class="sourceLineNo">189</span>    if (server != null &amp;&amp;
(t instanceof Error || t instanceof RuntimeException)) {<a name="line.189"></a>
-<span class="sourceLineNo">190</span>      server.abort(msg, t);<a name="line.190"></a>
-<span class="sourceLineNo">191</span>    }<a name="line.191"></a>
-<span class="sourceLineNo">192</span>  }<a name="line.192"></a>
-<span class="sourceLineNo">193</span>}<a name="line.193"></a>
+<span class="sourceLineNo">135</span>   * @return Integer.MAX_VALUE by default,
override to set higher priorities<a name="line.135"></a>
+<span class="sourceLineNo">136</span>   */<a name="line.136"></a>
+<span class="sourceLineNo">137</span>  public int getPriority() {<a name="line.137"></a>
+<span class="sourceLineNo">138</span>    return Integer.MAX_VALUE;<a name="line.138"></a>
+<span class="sourceLineNo">139</span>  }<a name="line.139"></a>
+<span class="sourceLineNo">140</span><a name="line.140"></a>
+<span class="sourceLineNo">141</span>  /**<a name="line.141"></a>
+<span class="sourceLineNo">142</span>   * @return This events' sequence id.<a
name="line.142"></a>
+<span class="sourceLineNo">143</span>   */<a name="line.143"></a>
+<span class="sourceLineNo">144</span>  public long getSeqid() {<a name="line.144"></a>
+<span class="sourceLineNo">145</span>    return this.seqid;<a name="line.145"></a>
+<span class="sourceLineNo">146</span>  }<a name="line.146"></a>
+<span class="sourceLineNo">147</span><a name="line.147"></a>
+<span class="sourceLineNo">148</span>  /**<a name="line.148"></a>
+<span class="sourceLineNo">149</span>   * Default prioritized runnable comparator
which implements a FIFO ordering.<a name="line.149"></a>
+<span class="sourceLineNo">150</span>   * &lt;p&gt;<a name="line.150"></a>
+<span class="sourceLineNo">151</span>   * Subclasses should not override this.
 Instead, if they want to implement<a name="line.151"></a>
+<span class="sourceLineNo">152</span>   * priority beyond FIFO, they should override
{@link #getPriority()}.<a name="line.152"></a>
+<span class="sourceLineNo">153</span>   */<a name="line.153"></a>
+<span class="sourceLineNo">154</span>  @Override<a name="line.154"></a>
+<span class="sourceLineNo">155</span>  public int compareTo(Runnable o) {<a
name="line.155"></a>
+<span class="sourceLineNo">156</span>    EventHandler eh = (EventHandler)o;<a
name="line.156"></a>
+<span class="sourceLineNo">157</span>    if(getPriority() != eh.getPriority())
{<a name="line.157"></a>
+<span class="sourceLineNo">158</span>      return (getPriority() &lt; eh.getPriority())
? -1 : 1;<a name="line.158"></a>
+<span class="sourceLineNo">159</span>    }<a name="line.159"></a>
+<span class="sourceLineNo">160</span>    return (this.seqid &lt; eh.seqid)
? -1 : 1;<a name="line.160"></a>
+<span class="sourceLineNo">161</span>  }<a name="line.161"></a>
+<span class="sourceLineNo">162</span><a name="line.162"></a>
+<span class="sourceLineNo">163</span>  @Override<a name="line.163"></a>
+<span class="sourceLineNo">164</span>  public String toString() {<a name="line.164"></a>
+<span class="sourceLineNo">165</span>    return "Event #" + getSeqid() +<a
name="line.165"></a>
+<span class="sourceLineNo">166</span>      " of type " + eventType +<a name="line.166"></a>
+<span class="sourceLineNo">167</span>      " (" + getInformativeName() + ")";<a
name="line.167"></a>
+<span class="sourceLineNo">168</span>  }<a name="line.168"></a>
+<span class="sourceLineNo">169</span><a name="line.169"></a>
+<span class="sourceLineNo">170</span>  /**<a name="line.170"></a>
+<span class="sourceLineNo">171</span>   * Event implementations should override
thie class to provide an<a name="line.171"></a>
+<span class="sourceLineNo">172</span>   * informative name about what event they
are handling. For example,<a name="line.172"></a>
+<span class="sourceLineNo">173</span>   * event-specific information such as
which region or server is<a name="line.173"></a>
+<span class="sourceLineNo">174</span>   * being processed should be included
if possible.<a name="line.174"></a>
+<span class="sourceLineNo">175</span>   */<a name="line.175"></a>
+<span class="sourceLineNo">176</span>  public String getInformativeName() {<a
name="line.176"></a>
+<span class="sourceLineNo">177</span>    return this.getClass().toString();<a
name="line.177"></a>
+<span class="sourceLineNo">178</span>  }<a name="line.178"></a>
+<span class="sourceLineNo">179</span><a name="line.179"></a>
+<span class="sourceLineNo">180</span>  /**<a name="line.180"></a>
+<span class="sourceLineNo">181</span>   * Event exception handler, may be overridden<a
name="line.181"></a>
+<span class="sourceLineNo">182</span>   * @param t Throwable object<a name="line.182"></a>
+<span class="sourceLineNo">183</span>   */<a name="line.183"></a>
+<span class="sourceLineNo">184</span>  protected void handleException(Throwable
t) {<a name="line.184"></a>
+<span class="sourceLineNo">185</span>    String msg = "Caught throwable while
processing event " + eventType;<a name="line.185"></a>
+<span class="sourceLineNo">186</span>    LOG.error(msg, t);<a name="line.186"></a>
+<span class="sourceLineNo">187</span>    if (server != null &amp;&amp;
(t instanceof Error || t instanceof RuntimeException)) {<a name="line.187"></a>
+<span class="sourceLineNo">188</span>      server.abort(msg, t);<a name="line.188"></a>
+<span class="sourceLineNo">189</span>    }<a name="line.189"></a>
+<span class="sourceLineNo">190</span>  }<a name="line.190"></a>
+<span class="sourceLineNo">191</span>}<a name="line.191"></a>
 
 
 


Mime
View raw message