hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [25/50] hbase-site git commit: Published site at .
Date Fri, 01 Dec 2017 15:18:40 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/a5c4dca3/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.WalProps.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.WalProps.html
b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.WalProps.html
index 3c517c6..5f7134b 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.WalProps.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.WalProps.html
@@ -977,86 +977,82 @@
 <span class="sourceLineNo">969</span>    try (TraceScope scope = TraceUtil.createTrace(implClassName
+ ".append")) {<a name="line.969"></a>
 <span class="sourceLineNo">970</span>      FSWALEntry entry = new FSWALEntry(txid,
key, edits, hri, inMemstore);<a name="line.970"></a>
 <span class="sourceLineNo">971</span>      entry.stampRegionSequenceId(we);<a
name="line.971"></a>
-<span class="sourceLineNo">972</span>      if (scope != null) {<a name="line.972"></a>
-<span class="sourceLineNo">973</span>        ringBuffer.get(txid).load(entry,
scope.getSpan());<a name="line.973"></a>
-<span class="sourceLineNo">974</span>      } else {<a name="line.974"></a>
-<span class="sourceLineNo">975</span>        ringBuffer.get(txid).load(entry,
null);<a name="line.975"></a>
-<span class="sourceLineNo">976</span>      }<a name="line.976"></a>
-<span class="sourceLineNo">977</span>    } finally {<a name="line.977"></a>
-<span class="sourceLineNo">978</span>      ringBuffer.publish(txid);<a name="line.978"></a>
-<span class="sourceLineNo">979</span>    }<a name="line.979"></a>
-<span class="sourceLineNo">980</span>    return txid;<a name="line.980"></a>
-<span class="sourceLineNo">981</span>  }<a name="line.981"></a>
-<span class="sourceLineNo">982</span><a name="line.982"></a>
-<span class="sourceLineNo">983</span>  @Override<a name="line.983"></a>
-<span class="sourceLineNo">984</span>  public String toString() {<a name="line.984"></a>
-<span class="sourceLineNo">985</span>    return implClassName + " " + walFilePrefix
+ ":" + walFileSuffix + "(num "<a name="line.985"></a>
-<span class="sourceLineNo">986</span>        + filenum + ")";<a name="line.986"></a>
-<span class="sourceLineNo">987</span>  }<a name="line.987"></a>
-<span class="sourceLineNo">988</span><a name="line.988"></a>
-<span class="sourceLineNo">989</span>  /**<a name="line.989"></a>
-<span class="sourceLineNo">990</span>   * if the given {@code path} is being
written currently, then return its length.<a name="line.990"></a>
-<span class="sourceLineNo">991</span>   * &lt;p&gt;<a name="line.991"></a>
-<span class="sourceLineNo">992</span>   * This is used by replication to prevent
replicating unacked log entries. See<a name="line.992"></a>
-<span class="sourceLineNo">993</span>   * https://issues.apache.org/jira/browse/HBASE-14004
for more details.<a name="line.993"></a>
-<span class="sourceLineNo">994</span>   */<a name="line.994"></a>
-<span class="sourceLineNo">995</span>  @Override<a name="line.995"></a>
-<span class="sourceLineNo">996</span>  public OptionalLong getLogFileSizeIfBeingWritten(Path
path) {<a name="line.996"></a>
-<span class="sourceLineNo">997</span>    rollWriterLock.lock();<a name="line.997"></a>
-<span class="sourceLineNo">998</span>    try {<a name="line.998"></a>
-<span class="sourceLineNo">999</span>      Path currentPath = getOldPath();<a
name="line.999"></a>
-<span class="sourceLineNo">1000</span>      if (path.equals(currentPath)) {<a
name="line.1000"></a>
-<span class="sourceLineNo">1001</span>        W writer = this.writer;<a name="line.1001"></a>
-<span class="sourceLineNo">1002</span>        return writer != null ? OptionalLong.of(writer.getLength())
: OptionalLong.empty();<a name="line.1002"></a>
-<span class="sourceLineNo">1003</span>      } else {<a name="line.1003"></a>
-<span class="sourceLineNo">1004</span>        return OptionalLong.empty();<a
name="line.1004"></a>
-<span class="sourceLineNo">1005</span>      }<a name="line.1005"></a>
-<span class="sourceLineNo">1006</span>    } finally {<a name="line.1006"></a>
-<span class="sourceLineNo">1007</span>      rollWriterLock.unlock();<a name="line.1007"></a>
-<span class="sourceLineNo">1008</span>    }<a name="line.1008"></a>
-<span class="sourceLineNo">1009</span>  }<a name="line.1009"></a>
-<span class="sourceLineNo">1010</span><a name="line.1010"></a>
-<span class="sourceLineNo">1011</span>  /**<a name="line.1011"></a>
-<span class="sourceLineNo">1012</span>   * NOTE: This append, at a time that
is usually after this call returns, starts an mvcc<a name="line.1012"></a>
-<span class="sourceLineNo">1013</span>   * transaction by calling 'begin' wherein
which we assign this update a sequenceid. At assignment<a name="line.1013"></a>
-<span class="sourceLineNo">1014</span>   * time, we stamp all the passed in Cells
inside WALEdit with their sequenceId. You must<a name="line.1014"></a>
-<span class="sourceLineNo">1015</span>   * 'complete' the transaction this mvcc
transaction by calling<a name="line.1015"></a>
-<span class="sourceLineNo">1016</span>   * MultiVersionConcurrencyControl#complete(...)
or a variant otherwise mvcc will get stuck. Do it<a name="line.1016"></a>
-<span class="sourceLineNo">1017</span>   * in the finally of a try/finally block
within which this append lives and any subsequent<a name="line.1017"></a>
-<span class="sourceLineNo">1018</span>   * operations like sync or update of
memstore, etc. Get the WriteEntry to pass mvcc out of the<a name="line.1018"></a>
-<span class="sourceLineNo">1019</span>   * passed in WALKey &lt;code&gt;walKey&lt;/code&gt;
parameter. Be warned that the WriteEntry is not<a name="line.1019"></a>
-<span class="sourceLineNo">1020</span>   * immediately available on return from
this method. It WILL be available subsequent to a sync of<a name="line.1020"></a>
-<span class="sourceLineNo">1021</span>   * this append; otherwise, you will just
have to wait on the WriteEntry to get filled in.<a name="line.1021"></a>
-<span class="sourceLineNo">1022</span>   */<a name="line.1022"></a>
-<span class="sourceLineNo">1023</span>  @Override<a name="line.1023"></a>
-<span class="sourceLineNo">1024</span>  public abstract long append(RegionInfo
info, WALKey key, WALEdit edits, boolean inMemstore)<a name="line.1024"></a>
-<span class="sourceLineNo">1025</span>      throws IOException;<a name="line.1025"></a>
-<span class="sourceLineNo">1026</span><a name="line.1026"></a>
-<span class="sourceLineNo">1027</span>  protected abstract void doAppend(W writer,
FSWALEntry entry) throws IOException;<a name="line.1027"></a>
-<span class="sourceLineNo">1028</span><a name="line.1028"></a>
-<span class="sourceLineNo">1029</span>  protected abstract W createWriterInstance(Path
path) throws IOException,<a name="line.1029"></a>
-<span class="sourceLineNo">1030</span>      CommonFSUtils.StreamLacksCapabilityException;<a
name="line.1030"></a>
-<span class="sourceLineNo">1031</span><a name="line.1031"></a>
-<span class="sourceLineNo">1032</span>  /**<a name="line.1032"></a>
-<span class="sourceLineNo">1033</span>   * @return old wal file size<a name="line.1033"></a>
-<span class="sourceLineNo">1034</span>   */<a name="line.1034"></a>
-<span class="sourceLineNo">1035</span>  protected abstract long doReplaceWriter(Path
oldPath, Path newPath, W nextWriter)<a name="line.1035"></a>
-<span class="sourceLineNo">1036</span>      throws IOException;<a name="line.1036"></a>
-<span class="sourceLineNo">1037</span><a name="line.1037"></a>
-<span class="sourceLineNo">1038</span>  protected abstract void doShutdown()
throws IOException;<a name="line.1038"></a>
-<span class="sourceLineNo">1039</span><a name="line.1039"></a>
-<span class="sourceLineNo">1040</span>  /**<a name="line.1040"></a>
-<span class="sourceLineNo">1041</span>   * This method gets the pipeline for
the current WAL.<a name="line.1041"></a>
-<span class="sourceLineNo">1042</span>   */<a name="line.1042"></a>
-<span class="sourceLineNo">1043</span>  @VisibleForTesting<a name="line.1043"></a>
-<span class="sourceLineNo">1044</span>  abstract DatanodeInfo[] getPipeline();<a
name="line.1044"></a>
-<span class="sourceLineNo">1045</span><a name="line.1045"></a>
-<span class="sourceLineNo">1046</span>  /**<a name="line.1046"></a>
-<span class="sourceLineNo">1047</span>   * This method gets the datanode replication
count for the current WAL.<a name="line.1047"></a>
-<span class="sourceLineNo">1048</span>   */<a name="line.1048"></a>
-<span class="sourceLineNo">1049</span>  @VisibleForTesting<a name="line.1049"></a>
-<span class="sourceLineNo">1050</span>  abstract int getLogReplication();<a
name="line.1050"></a>
-<span class="sourceLineNo">1051</span>}<a name="line.1051"></a>
+<span class="sourceLineNo">972</span>      ringBuffer.get(txid).load(entry);<a
name="line.972"></a>
+<span class="sourceLineNo">973</span>    } finally {<a name="line.973"></a>
+<span class="sourceLineNo">974</span>      ringBuffer.publish(txid);<a name="line.974"></a>
+<span class="sourceLineNo">975</span>    }<a name="line.975"></a>
+<span class="sourceLineNo">976</span>    return txid;<a name="line.976"></a>
+<span class="sourceLineNo">977</span>  }<a name="line.977"></a>
+<span class="sourceLineNo">978</span><a name="line.978"></a>
+<span class="sourceLineNo">979</span>  @Override<a name="line.979"></a>
+<span class="sourceLineNo">980</span>  public String toString() {<a name="line.980"></a>
+<span class="sourceLineNo">981</span>    return implClassName + " " + walFilePrefix
+ ":" + walFileSuffix + "(num "<a name="line.981"></a>
+<span class="sourceLineNo">982</span>        + filenum + ")";<a name="line.982"></a>
+<span class="sourceLineNo">983</span>  }<a name="line.983"></a>
+<span class="sourceLineNo">984</span><a name="line.984"></a>
+<span class="sourceLineNo">985</span>  /**<a name="line.985"></a>
+<span class="sourceLineNo">986</span>   * if the given {@code path} is being
written currently, then return its length.<a name="line.986"></a>
+<span class="sourceLineNo">987</span>   * &lt;p&gt;<a name="line.987"></a>
+<span class="sourceLineNo">988</span>   * This is used by replication to prevent
replicating unacked log entries. See<a name="line.988"></a>
+<span class="sourceLineNo">989</span>   * https://issues.apache.org/jira/browse/HBASE-14004
for more details.<a name="line.989"></a>
+<span class="sourceLineNo">990</span>   */<a name="line.990"></a>
+<span class="sourceLineNo">991</span>  @Override<a name="line.991"></a>
+<span class="sourceLineNo">992</span>  public OptionalLong getLogFileSizeIfBeingWritten(Path
path) {<a name="line.992"></a>
+<span class="sourceLineNo">993</span>    rollWriterLock.lock();<a name="line.993"></a>
+<span class="sourceLineNo">994</span>    try {<a name="line.994"></a>
+<span class="sourceLineNo">995</span>      Path currentPath = getOldPath();<a
name="line.995"></a>
+<span class="sourceLineNo">996</span>      if (path.equals(currentPath)) {<a
name="line.996"></a>
+<span class="sourceLineNo">997</span>        W writer = this.writer;<a name="line.997"></a>
+<span class="sourceLineNo">998</span>        return writer != null ? OptionalLong.of(writer.getLength())
: OptionalLong.empty();<a name="line.998"></a>
+<span class="sourceLineNo">999</span>      } else {<a name="line.999"></a>
+<span class="sourceLineNo">1000</span>        return OptionalLong.empty();<a
name="line.1000"></a>
+<span class="sourceLineNo">1001</span>      }<a name="line.1001"></a>
+<span class="sourceLineNo">1002</span>    } finally {<a name="line.1002"></a>
+<span class="sourceLineNo">1003</span>      rollWriterLock.unlock();<a name="line.1003"></a>
+<span class="sourceLineNo">1004</span>    }<a name="line.1004"></a>
+<span class="sourceLineNo">1005</span>  }<a name="line.1005"></a>
+<span class="sourceLineNo">1006</span><a name="line.1006"></a>
+<span class="sourceLineNo">1007</span>  /**<a name="line.1007"></a>
+<span class="sourceLineNo">1008</span>   * NOTE: This append, at a time that
is usually after this call returns, starts an mvcc<a name="line.1008"></a>
+<span class="sourceLineNo">1009</span>   * transaction by calling 'begin' wherein
which we assign this update a sequenceid. At assignment<a name="line.1009"></a>
+<span class="sourceLineNo">1010</span>   * time, we stamp all the passed in Cells
inside WALEdit with their sequenceId. You must<a name="line.1010"></a>
+<span class="sourceLineNo">1011</span>   * 'complete' the transaction this mvcc
transaction by calling<a name="line.1011"></a>
+<span class="sourceLineNo">1012</span>   * MultiVersionConcurrencyControl#complete(...)
or a variant otherwise mvcc will get stuck. Do it<a name="line.1012"></a>
+<span class="sourceLineNo">1013</span>   * in the finally of a try/finally block
within which this append lives and any subsequent<a name="line.1013"></a>
+<span class="sourceLineNo">1014</span>   * operations like sync or update of
memstore, etc. Get the WriteEntry to pass mvcc out of the<a name="line.1014"></a>
+<span class="sourceLineNo">1015</span>   * passed in WALKey &lt;code&gt;walKey&lt;/code&gt;
parameter. Be warned that the WriteEntry is not<a name="line.1015"></a>
+<span class="sourceLineNo">1016</span>   * immediately available on return from
this method. It WILL be available subsequent to a sync of<a name="line.1016"></a>
+<span class="sourceLineNo">1017</span>   * this append; otherwise, you will just
have to wait on the WriteEntry to get filled in.<a name="line.1017"></a>
+<span class="sourceLineNo">1018</span>   */<a name="line.1018"></a>
+<span class="sourceLineNo">1019</span>  @Override<a name="line.1019"></a>
+<span class="sourceLineNo">1020</span>  public abstract long append(RegionInfo
info, WALKey key, WALEdit edits, boolean inMemstore)<a name="line.1020"></a>
+<span class="sourceLineNo">1021</span>      throws IOException;<a name="line.1021"></a>
+<span class="sourceLineNo">1022</span><a name="line.1022"></a>
+<span class="sourceLineNo">1023</span>  protected abstract void doAppend(W writer,
FSWALEntry entry) throws IOException;<a name="line.1023"></a>
+<span class="sourceLineNo">1024</span><a name="line.1024"></a>
+<span class="sourceLineNo">1025</span>  protected abstract W createWriterInstance(Path
path) throws IOException,<a name="line.1025"></a>
+<span class="sourceLineNo">1026</span>      CommonFSUtils.StreamLacksCapabilityException;<a
name="line.1026"></a>
+<span class="sourceLineNo">1027</span><a name="line.1027"></a>
+<span class="sourceLineNo">1028</span>  /**<a name="line.1028"></a>
+<span class="sourceLineNo">1029</span>   * @return old wal file size<a name="line.1029"></a>
+<span class="sourceLineNo">1030</span>   */<a name="line.1030"></a>
+<span class="sourceLineNo">1031</span>  protected abstract long doReplaceWriter(Path
oldPath, Path newPath, W nextWriter)<a name="line.1031"></a>
+<span class="sourceLineNo">1032</span>      throws IOException;<a name="line.1032"></a>
+<span class="sourceLineNo">1033</span><a name="line.1033"></a>
+<span class="sourceLineNo">1034</span>  protected abstract void doShutdown()
throws IOException;<a name="line.1034"></a>
+<span class="sourceLineNo">1035</span><a name="line.1035"></a>
+<span class="sourceLineNo">1036</span>  /**<a name="line.1036"></a>
+<span class="sourceLineNo">1037</span>   * This method gets the pipeline for
the current WAL.<a name="line.1037"></a>
+<span class="sourceLineNo">1038</span>   */<a name="line.1038"></a>
+<span class="sourceLineNo">1039</span>  @VisibleForTesting<a name="line.1039"></a>
+<span class="sourceLineNo">1040</span>  abstract DatanodeInfo[] getPipeline();<a
name="line.1040"></a>
+<span class="sourceLineNo">1041</span><a name="line.1041"></a>
+<span class="sourceLineNo">1042</span>  /**<a name="line.1042"></a>
+<span class="sourceLineNo">1043</span>   * This method gets the datanode replication
count for the current WAL.<a name="line.1043"></a>
+<span class="sourceLineNo">1044</span>   */<a name="line.1044"></a>
+<span class="sourceLineNo">1045</span>  @VisibleForTesting<a name="line.1045"></a>
+<span class="sourceLineNo">1046</span>  abstract int getLogReplication();<a
name="line.1046"></a>
+<span class="sourceLineNo">1047</span>}<a name="line.1047"></a>
 
 
 

http://git-wip-us.apache.org/repos/asf/hbase-site/blob/a5c4dca3/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.html
b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.html
index 3c517c6..5f7134b 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/regionserver/wal/AbstractFSWAL.html
@@ -977,86 +977,82 @@
 <span class="sourceLineNo">969</span>    try (TraceScope scope = TraceUtil.createTrace(implClassName
+ ".append")) {<a name="line.969"></a>
 <span class="sourceLineNo">970</span>      FSWALEntry entry = new FSWALEntry(txid,
key, edits, hri, inMemstore);<a name="line.970"></a>
 <span class="sourceLineNo">971</span>      entry.stampRegionSequenceId(we);<a
name="line.971"></a>
-<span class="sourceLineNo">972</span>      if (scope != null) {<a name="line.972"></a>
-<span class="sourceLineNo">973</span>        ringBuffer.get(txid).load(entry,
scope.getSpan());<a name="line.973"></a>
-<span class="sourceLineNo">974</span>      } else {<a name="line.974"></a>
-<span class="sourceLineNo">975</span>        ringBuffer.get(txid).load(entry,
null);<a name="line.975"></a>
-<span class="sourceLineNo">976</span>      }<a name="line.976"></a>
-<span class="sourceLineNo">977</span>    } finally {<a name="line.977"></a>
-<span class="sourceLineNo">978</span>      ringBuffer.publish(txid);<a name="line.978"></a>
-<span class="sourceLineNo">979</span>    }<a name="line.979"></a>
-<span class="sourceLineNo">980</span>    return txid;<a name="line.980"></a>
-<span class="sourceLineNo">981</span>  }<a name="line.981"></a>
-<span class="sourceLineNo">982</span><a name="line.982"></a>
-<span class="sourceLineNo">983</span>  @Override<a name="line.983"></a>
-<span class="sourceLineNo">984</span>  public String toString() {<a name="line.984"></a>
-<span class="sourceLineNo">985</span>    return implClassName + " " + walFilePrefix
+ ":" + walFileSuffix + "(num "<a name="line.985"></a>
-<span class="sourceLineNo">986</span>        + filenum + ")";<a name="line.986"></a>
-<span class="sourceLineNo">987</span>  }<a name="line.987"></a>
-<span class="sourceLineNo">988</span><a name="line.988"></a>
-<span class="sourceLineNo">989</span>  /**<a name="line.989"></a>
-<span class="sourceLineNo">990</span>   * if the given {@code path} is being
written currently, then return its length.<a name="line.990"></a>
-<span class="sourceLineNo">991</span>   * &lt;p&gt;<a name="line.991"></a>
-<span class="sourceLineNo">992</span>   * This is used by replication to prevent
replicating unacked log entries. See<a name="line.992"></a>
-<span class="sourceLineNo">993</span>   * https://issues.apache.org/jira/browse/HBASE-14004
for more details.<a name="line.993"></a>
-<span class="sourceLineNo">994</span>   */<a name="line.994"></a>
-<span class="sourceLineNo">995</span>  @Override<a name="line.995"></a>
-<span class="sourceLineNo">996</span>  public OptionalLong getLogFileSizeIfBeingWritten(Path
path) {<a name="line.996"></a>
-<span class="sourceLineNo">997</span>    rollWriterLock.lock();<a name="line.997"></a>
-<span class="sourceLineNo">998</span>    try {<a name="line.998"></a>
-<span class="sourceLineNo">999</span>      Path currentPath = getOldPath();<a
name="line.999"></a>
-<span class="sourceLineNo">1000</span>      if (path.equals(currentPath)) {<a
name="line.1000"></a>
-<span class="sourceLineNo">1001</span>        W writer = this.writer;<a name="line.1001"></a>
-<span class="sourceLineNo">1002</span>        return writer != null ? OptionalLong.of(writer.getLength())
: OptionalLong.empty();<a name="line.1002"></a>
-<span class="sourceLineNo">1003</span>      } else {<a name="line.1003"></a>
-<span class="sourceLineNo">1004</span>        return OptionalLong.empty();<a
name="line.1004"></a>
-<span class="sourceLineNo">1005</span>      }<a name="line.1005"></a>
-<span class="sourceLineNo">1006</span>    } finally {<a name="line.1006"></a>
-<span class="sourceLineNo">1007</span>      rollWriterLock.unlock();<a name="line.1007"></a>
-<span class="sourceLineNo">1008</span>    }<a name="line.1008"></a>
-<span class="sourceLineNo">1009</span>  }<a name="line.1009"></a>
-<span class="sourceLineNo">1010</span><a name="line.1010"></a>
-<span class="sourceLineNo">1011</span>  /**<a name="line.1011"></a>
-<span class="sourceLineNo">1012</span>   * NOTE: This append, at a time that
is usually after this call returns, starts an mvcc<a name="line.1012"></a>
-<span class="sourceLineNo">1013</span>   * transaction by calling 'begin' wherein
which we assign this update a sequenceid. At assignment<a name="line.1013"></a>
-<span class="sourceLineNo">1014</span>   * time, we stamp all the passed in Cells
inside WALEdit with their sequenceId. You must<a name="line.1014"></a>
-<span class="sourceLineNo">1015</span>   * 'complete' the transaction this mvcc
transaction by calling<a name="line.1015"></a>
-<span class="sourceLineNo">1016</span>   * MultiVersionConcurrencyControl#complete(...)
or a variant otherwise mvcc will get stuck. Do it<a name="line.1016"></a>
-<span class="sourceLineNo">1017</span>   * in the finally of a try/finally block
within which this append lives and any subsequent<a name="line.1017"></a>
-<span class="sourceLineNo">1018</span>   * operations like sync or update of
memstore, etc. Get the WriteEntry to pass mvcc out of the<a name="line.1018"></a>
-<span class="sourceLineNo">1019</span>   * passed in WALKey &lt;code&gt;walKey&lt;/code&gt;
parameter. Be warned that the WriteEntry is not<a name="line.1019"></a>
-<span class="sourceLineNo">1020</span>   * immediately available on return from
this method. It WILL be available subsequent to a sync of<a name="line.1020"></a>
-<span class="sourceLineNo">1021</span>   * this append; otherwise, you will just
have to wait on the WriteEntry to get filled in.<a name="line.1021"></a>
-<span class="sourceLineNo">1022</span>   */<a name="line.1022"></a>
-<span class="sourceLineNo">1023</span>  @Override<a name="line.1023"></a>
-<span class="sourceLineNo">1024</span>  public abstract long append(RegionInfo
info, WALKey key, WALEdit edits, boolean inMemstore)<a name="line.1024"></a>
-<span class="sourceLineNo">1025</span>      throws IOException;<a name="line.1025"></a>
-<span class="sourceLineNo">1026</span><a name="line.1026"></a>
-<span class="sourceLineNo">1027</span>  protected abstract void doAppend(W writer,
FSWALEntry entry) throws IOException;<a name="line.1027"></a>
-<span class="sourceLineNo">1028</span><a name="line.1028"></a>
-<span class="sourceLineNo">1029</span>  protected abstract W createWriterInstance(Path
path) throws IOException,<a name="line.1029"></a>
-<span class="sourceLineNo">1030</span>      CommonFSUtils.StreamLacksCapabilityException;<a
name="line.1030"></a>
-<span class="sourceLineNo">1031</span><a name="line.1031"></a>
-<span class="sourceLineNo">1032</span>  /**<a name="line.1032"></a>
-<span class="sourceLineNo">1033</span>   * @return old wal file size<a name="line.1033"></a>
-<span class="sourceLineNo">1034</span>   */<a name="line.1034"></a>
-<span class="sourceLineNo">1035</span>  protected abstract long doReplaceWriter(Path
oldPath, Path newPath, W nextWriter)<a name="line.1035"></a>
-<span class="sourceLineNo">1036</span>      throws IOException;<a name="line.1036"></a>
-<span class="sourceLineNo">1037</span><a name="line.1037"></a>
-<span class="sourceLineNo">1038</span>  protected abstract void doShutdown()
throws IOException;<a name="line.1038"></a>
-<span class="sourceLineNo">1039</span><a name="line.1039"></a>
-<span class="sourceLineNo">1040</span>  /**<a name="line.1040"></a>
-<span class="sourceLineNo">1041</span>   * This method gets the pipeline for
the current WAL.<a name="line.1041"></a>
-<span class="sourceLineNo">1042</span>   */<a name="line.1042"></a>
-<span class="sourceLineNo">1043</span>  @VisibleForTesting<a name="line.1043"></a>
-<span class="sourceLineNo">1044</span>  abstract DatanodeInfo[] getPipeline();<a
name="line.1044"></a>
-<span class="sourceLineNo">1045</span><a name="line.1045"></a>
-<span class="sourceLineNo">1046</span>  /**<a name="line.1046"></a>
-<span class="sourceLineNo">1047</span>   * This method gets the datanode replication
count for the current WAL.<a name="line.1047"></a>
-<span class="sourceLineNo">1048</span>   */<a name="line.1048"></a>
-<span class="sourceLineNo">1049</span>  @VisibleForTesting<a name="line.1049"></a>
-<span class="sourceLineNo">1050</span>  abstract int getLogReplication();<a
name="line.1050"></a>
-<span class="sourceLineNo">1051</span>}<a name="line.1051"></a>
+<span class="sourceLineNo">972</span>      ringBuffer.get(txid).load(entry);<a
name="line.972"></a>
+<span class="sourceLineNo">973</span>    } finally {<a name="line.973"></a>
+<span class="sourceLineNo">974</span>      ringBuffer.publish(txid);<a name="line.974"></a>
+<span class="sourceLineNo">975</span>    }<a name="line.975"></a>
+<span class="sourceLineNo">976</span>    return txid;<a name="line.976"></a>
+<span class="sourceLineNo">977</span>  }<a name="line.977"></a>
+<span class="sourceLineNo">978</span><a name="line.978"></a>
+<span class="sourceLineNo">979</span>  @Override<a name="line.979"></a>
+<span class="sourceLineNo">980</span>  public String toString() {<a name="line.980"></a>
+<span class="sourceLineNo">981</span>    return implClassName + " " + walFilePrefix
+ ":" + walFileSuffix + "(num "<a name="line.981"></a>
+<span class="sourceLineNo">982</span>        + filenum + ")";<a name="line.982"></a>
+<span class="sourceLineNo">983</span>  }<a name="line.983"></a>
+<span class="sourceLineNo">984</span><a name="line.984"></a>
+<span class="sourceLineNo">985</span>  /**<a name="line.985"></a>
+<span class="sourceLineNo">986</span>   * if the given {@code path} is being
written currently, then return its length.<a name="line.986"></a>
+<span class="sourceLineNo">987</span>   * &lt;p&gt;<a name="line.987"></a>
+<span class="sourceLineNo">988</span>   * This is used by replication to prevent
replicating unacked log entries. See<a name="line.988"></a>
+<span class="sourceLineNo">989</span>   * https://issues.apache.org/jira/browse/HBASE-14004
for more details.<a name="line.989"></a>
+<span class="sourceLineNo">990</span>   */<a name="line.990"></a>
+<span class="sourceLineNo">991</span>  @Override<a name="line.991"></a>
+<span class="sourceLineNo">992</span>  public OptionalLong getLogFileSizeIfBeingWritten(Path
path) {<a name="line.992"></a>
+<span class="sourceLineNo">993</span>    rollWriterLock.lock();<a name="line.993"></a>
+<span class="sourceLineNo">994</span>    try {<a name="line.994"></a>
+<span class="sourceLineNo">995</span>      Path currentPath = getOldPath();<a
name="line.995"></a>
+<span class="sourceLineNo">996</span>      if (path.equals(currentPath)) {<a
name="line.996"></a>
+<span class="sourceLineNo">997</span>        W writer = this.writer;<a name="line.997"></a>
+<span class="sourceLineNo">998</span>        return writer != null ? OptionalLong.of(writer.getLength())
: OptionalLong.empty();<a name="line.998"></a>
+<span class="sourceLineNo">999</span>      } else {<a name="line.999"></a>
+<span class="sourceLineNo">1000</span>        return OptionalLong.empty();<a
name="line.1000"></a>
+<span class="sourceLineNo">1001</span>      }<a name="line.1001"></a>
+<span class="sourceLineNo">1002</span>    } finally {<a name="line.1002"></a>
+<span class="sourceLineNo">1003</span>      rollWriterLock.unlock();<a name="line.1003"></a>
+<span class="sourceLineNo">1004</span>    }<a name="line.1004"></a>
+<span class="sourceLineNo">1005</span>  }<a name="line.1005"></a>
+<span class="sourceLineNo">1006</span><a name="line.1006"></a>
+<span class="sourceLineNo">1007</span>  /**<a name="line.1007"></a>
+<span class="sourceLineNo">1008</span>   * NOTE: This append, at a time that
is usually after this call returns, starts an mvcc<a name="line.1008"></a>
+<span class="sourceLineNo">1009</span>   * transaction by calling 'begin' wherein
which we assign this update a sequenceid. At assignment<a name="line.1009"></a>
+<span class="sourceLineNo">1010</span>   * time, we stamp all the passed in Cells
inside WALEdit with their sequenceId. You must<a name="line.1010"></a>
+<span class="sourceLineNo">1011</span>   * 'complete' the transaction this mvcc
transaction by calling<a name="line.1011"></a>
+<span class="sourceLineNo">1012</span>   * MultiVersionConcurrencyControl#complete(...)
or a variant otherwise mvcc will get stuck. Do it<a name="line.1012"></a>
+<span class="sourceLineNo">1013</span>   * in the finally of a try/finally block
within which this append lives and any subsequent<a name="line.1013"></a>
+<span class="sourceLineNo">1014</span>   * operations like sync or update of
memstore, etc. Get the WriteEntry to pass mvcc out of the<a name="line.1014"></a>
+<span class="sourceLineNo">1015</span>   * passed in WALKey &lt;code&gt;walKey&lt;/code&gt;
parameter. Be warned that the WriteEntry is not<a name="line.1015"></a>
+<span class="sourceLineNo">1016</span>   * immediately available on return from
this method. It WILL be available subsequent to a sync of<a name="line.1016"></a>
+<span class="sourceLineNo">1017</span>   * this append; otherwise, you will just
have to wait on the WriteEntry to get filled in.<a name="line.1017"></a>
+<span class="sourceLineNo">1018</span>   */<a name="line.1018"></a>
+<span class="sourceLineNo">1019</span>  @Override<a name="line.1019"></a>
+<span class="sourceLineNo">1020</span>  public abstract long append(RegionInfo
info, WALKey key, WALEdit edits, boolean inMemstore)<a name="line.1020"></a>
+<span class="sourceLineNo">1021</span>      throws IOException;<a name="line.1021"></a>
+<span class="sourceLineNo">1022</span><a name="line.1022"></a>
+<span class="sourceLineNo">1023</span>  protected abstract void doAppend(W writer,
FSWALEntry entry) throws IOException;<a name="line.1023"></a>
+<span class="sourceLineNo">1024</span><a name="line.1024"></a>
+<span class="sourceLineNo">1025</span>  protected abstract W createWriterInstance(Path
path) throws IOException,<a name="line.1025"></a>
+<span class="sourceLineNo">1026</span>      CommonFSUtils.StreamLacksCapabilityException;<a
name="line.1026"></a>
+<span class="sourceLineNo">1027</span><a name="line.1027"></a>
+<span class="sourceLineNo">1028</span>  /**<a name="line.1028"></a>
+<span class="sourceLineNo">1029</span>   * @return old wal file size<a name="line.1029"></a>
+<span class="sourceLineNo">1030</span>   */<a name="line.1030"></a>
+<span class="sourceLineNo">1031</span>  protected abstract long doReplaceWriter(Path
oldPath, Path newPath, W nextWriter)<a name="line.1031"></a>
+<span class="sourceLineNo">1032</span>      throws IOException;<a name="line.1032"></a>
+<span class="sourceLineNo">1033</span><a name="line.1033"></a>
+<span class="sourceLineNo">1034</span>  protected abstract void doShutdown()
throws IOException;<a name="line.1034"></a>
+<span class="sourceLineNo">1035</span><a name="line.1035"></a>
+<span class="sourceLineNo">1036</span>  /**<a name="line.1036"></a>
+<span class="sourceLineNo">1037</span>   * This method gets the pipeline for
the current WAL.<a name="line.1037"></a>
+<span class="sourceLineNo">1038</span>   */<a name="line.1038"></a>
+<span class="sourceLineNo">1039</span>  @VisibleForTesting<a name="line.1039"></a>
+<span class="sourceLineNo">1040</span>  abstract DatanodeInfo[] getPipeline();<a
name="line.1040"></a>
+<span class="sourceLineNo">1041</span><a name="line.1041"></a>
+<span class="sourceLineNo">1042</span>  /**<a name="line.1042"></a>
+<span class="sourceLineNo">1043</span>   * This method gets the datanode replication
count for the current WAL.<a name="line.1043"></a>
+<span class="sourceLineNo">1044</span>   */<a name="line.1044"></a>
+<span class="sourceLineNo">1045</span>  @VisibleForTesting<a name="line.1045"></a>
+<span class="sourceLineNo">1046</span>  abstract int getLogReplication();<a
name="line.1046"></a>
+<span class="sourceLineNo">1047</span>}<a name="line.1047"></a>
 
 
 


Mime
View raw message