Skip to content

Commit

Permalink
Fix javadoc warnings in intellij
Browse files Browse the repository at this point in the history
  • Loading branch information
eincs committed Feb 6, 2015
1 parent 94edbeb commit 19ea6f0
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 51 deletions.
5 changes: 0 additions & 5 deletions src/main/java/kr/co/vcnc/haeinsa/ForwardingHaeinsaTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
public class ForwardingHaeinsaTable extends ForwardingObject implements HaeinsaTableIfaceInternal {
private final HaeinsaTableIfaceInternal delegate;

/**
* Constructor
*
* @param haeinsaTable HaeinsaTable
*/
public ForwardingHaeinsaTable(HaeinsaTableIface haeinsaTable) {
Preconditions.checkArgument(haeinsaTable instanceof HaeinsaTableIfaceInternal);
this.delegate = (HaeinsaTableIfaceInternal) haeinsaTable;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/kr/co/vcnc/haeinsa/HaeinsaColumnTracker.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ public class HaeinsaColumnTracker {
* Constructor of HaeinsaColumnTracker.
* <p>
* If this ColumnTracker track {@link HaeinsaScan}, minColumn, maxColumn
* should be null and minColumnInclusive, maxColumnInclusive should be
* false.
* should be null and minColumnInclusive, maxColumnInclusive should be false.
*/
public HaeinsaColumnTracker(Map<byte[], NavigableSet<byte[]>> familyMap,
byte[] minColumn, boolean minColumnInclusive,
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/kr/co/vcnc/haeinsa/HaeinsaDelete.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import com.google.common.collect.Sets;

/**
* Implementation of {@link HaeinsaMuation} which only contains HaeinsaKeyValue
* Implementation of {@link HaeinsaMutation} which only contains HaeinsaKeyValue
* with {@link Type#DeleteFamily} and {@link Type#DeleteColumn} identifier.
* HaeinsaPut can be analogous to {@link Delete} class in HBase.
* <p>
Expand Down
10 changes: 4 additions & 6 deletions src/main/java/kr/co/vcnc/haeinsa/HaeinsaDeleteTracker.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ public class HaeinsaDeleteTracker {
private final NavigableMap<byte[], NavigableMap<byte[], Long>> cells = Maps.newTreeMap(Bytes.BYTES_COMPARATOR);

/**
* Update family map or column map if kv is not exist in map or sequenceId
* is lower.
* Update family map or column map if kv is not exist in map or sequenceId is lower.
*
* @param kv - HaeinsaKeyValue to track
* @param sequenceID - sequence ID, lower is newer.
* @param kv HaeinsaKeyValue to track
* @param sequenceID sequence ID, lower is newer.
*/
public void add(HaeinsaKeyValue kv, long sequenceID) {
switch (kv.getType()) {
Expand Down Expand Up @@ -67,8 +66,7 @@ public void add(HaeinsaKeyValue kv, long sequenceID) {
}

/**
* @return Return true if kv is deleted after sequenceID (lower sequenceID),
* return false otherwise.
* @return Return true if kv is deleted after sequenceID (lower sequenceID), return false otherwise.
*/
public boolean isDeleted(HaeinsaKeyValue kv, long sequenceID) {
// check family
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/kr/co/vcnc/haeinsa/HaeinsaKeyValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
* same Enum with {@link org.apache.hadoop.hbase.KeyValue.Type}.
* <p>
* HaeinsaKeyValue has public static comparator which can be used in
* navigableMap. This comparator is ComparisionChain of {@link NullableCompator}
* navigableMap. This comparator is ComparisionChain of {@link NullableComparator}
* wrapped {@link org.apache.hadoop.hbase.util.Bytes#BYTES_COMPARATOR}. The
* order of comparisonChain is row, family, qualifier, value and type.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/kr/co/vcnc/haeinsa/HaeinsaMutation.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
* These late Get/Scan operations can see the mutated view of specific row
* even before those mutations are committed to HBase.
* <p>
* HaeinsaMutation provides {@link HaeinsaKeyValueScanner} interface by {@link #getScanner()} method.
* HaeinsaMutation provides {@link HaeinsaKeyValueScanner} interface by {@link #getScanner(long)} method.
*/
public abstract class HaeinsaMutation extends HaeinsaOperation {
protected byte[] row;
Expand Down Expand Up @@ -103,7 +103,7 @@ public int compareTo(final Row d) {
public abstract TMutation toTMutation();

/**
* Return {@link #HaeinsaKeyValueScanner} interface for single row.
* Return {@link HaeinsaKeyValueScanner} interface for single row.
*
* @param sequenceID sequence id represent which Scanner is newer one. Lower
* id is newer one.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/kr/co/vcnc/haeinsa/HaeinsaPut.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import com.google.common.collect.Sets;

/**
* Implementation of {@link HaeinsaMuation} which only contains HaeinsaKeyValue
* Implementation of {@link HaeinsaMutation} which only contains HaeinsaKeyValue
* with {@link Type#Put} identifier. HaeinsaPut can be analogous to {@link Put}
* class in HBase.
* <p>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/kr/co/vcnc/haeinsa/HaeinsaRowTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ public HaeinsaTableTransaction getTableTransaction() {
}

/**
* Return list of {@link HaeinsaKeyValueScanner}s which wrap mutations -
* (Put & Delete) contained inside instance. Also assign sequenceID to every
* {@link HaeinsaMutation#MutationScanner}.
* Return list of {@link HaeinsaKeyValueScanner}s which wrap mutations
* (Put and Delete) contained inside instance. Also assign sequenceID to every
* MutationScanner of {@link HaeinsaMutation}.
*/
public List<HaeinsaKeyValueScanner> getScanners() {
List<HaeinsaKeyValueScanner> result = Lists.newArrayList();
Expand Down
28 changes: 14 additions & 14 deletions src/main/java/kr/co/vcnc/haeinsa/HaeinsaTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ public HaeinsaResultScanner getScanner(@Nullable HaeinsaTransaction tx, byte[] f
/**
* Haeinsa implementation of {@link Scan}.
* Scan range of row inside defined by {@link HaeinsaScan} in the context of transaction(tx).
* Return {@link #ClientScanner} which related to {@link HaeinsaTable} and {@link HaeinsaTransaction}.
* Return ClientScanner which related to {@link HaeinsaTable} and {@link HaeinsaTransaction}.
* <p>
* Return {@link SimpleClientScanner} which do not support transaction if tx is null.
* User can use this feature if specific scan operation does not require strong consistency
Expand Down Expand Up @@ -291,7 +291,7 @@ private HaeinsaResultScanner getScannerWithoutTx(HaeinsaScan scan) throws IOExce
/**
* Haeinsa implementation of {@link ColumnRangeFilter}.
* Scan range of column inside single row defined by {@link HaeinsaIntraScan} in the context of transaction(tx).
* Return {@link #ClientScanner} which related to {@link HaeinsaTable} and {@link HaeinsaTransaction}.
* Return {@link ClientScanner} which related to {@link HaeinsaTable} and {@link HaeinsaTransaction}.
* <p>
* Return {@link SimpleClientScanner} which do not support transaction if tx is null.
* User can use this feature if specific intra-scan operation does not require strong consistency.
Expand Down Expand Up @@ -380,9 +380,9 @@ public void put(HaeinsaTransaction tx, HaeinsaPut put) throws IOException {
* Check rowState and whether it contains {@link TRowLock} already, create one if not.
* <p>
* Get {@link TRowLock} of the row from HBase if rowState does not contains it.
* If lock is not in stable state, try to recover it first by {@link HaeinsaTrasaction#recover()}.
* If lock is not in stable state, try to recover it first by {@link HaeinsaTransaction#recover(boolean)}.
* <p>
* By calling this method proper time, {@link RowTransaction} inside {@link HaeinsaTransaction} can have
* By calling this method proper time, {@link HaeinsaRowTransaction} inside {@link HaeinsaTransaction} can have
* {@link TRowLock} of the row when this method was called first time in the context of the transaction.
*
* @throws IOException ConflictException, HBase IOException
Expand Down Expand Up @@ -441,7 +441,7 @@ private boolean checkAndIsShouldRecover(TRowLock rowLock) throws IOException {
}

/**
* Call {@link HaeinsaTransaction#recover()}.
* Call {@link HaeinsaTransaction#recover(boolean)}.
* Abort or recover when there is failed transaction on the row,
* throw {@link ConflictException} when there is ongoing transaction.
*
Expand Down Expand Up @@ -526,8 +526,7 @@ public void commitSingleRowPutOnly(HaeinsaRowTransaction rowState, byte[] row) t
* {@link ConflictException}.
*
* @throws IOException ConflictException, HBase IOException.
* @throws NullPointException if oldLock is null (haven't read lock from
* HBase)
* @throws NullPointerException if oldLock is null (haven't read lock from HBase)
*/
@Override
public void checkSingleRowLock(HaeinsaRowTransaction rowState, byte[] row) throws IOException {
Expand Down Expand Up @@ -781,7 +780,7 @@ protected HTableInterface getHTable() {
}

/**
* Implementation of {@link HaeinsaReulstScanner} which is used when scan without transaction.
* Implementation of {@link HaeinsaResultScanner} which is used when scan without transaction.
*/
private class SimpleClientScanner implements HaeinsaResultScanner {
private final ResultScanner scanner;
Expand Down Expand Up @@ -863,7 +862,7 @@ private class ClientScanner implements HaeinsaResultScanner {

/**
* @param lockInclusive - whether scanners contains {@link TRowLock} inside.
* If not, should bring from {@link RowTransaction} or get from HBase directly.
* If not, should bring from {@link HaeinsaRowTransaction} or get from HBase directly.
*/
public ClientScanner(HaeinsaTransaction tx, Iterable<HaeinsaKeyValueScanner> scanners,
Map<byte[], NavigableSet<byte[]>> familyMap, boolean lockInclusive) {
Expand All @@ -873,7 +872,7 @@ public ClientScanner(HaeinsaTransaction tx, Iterable<HaeinsaKeyValueScanner> sca
/**
* @param intraScan - To support to use {@link ColumnRangeFilter}
* @param lockInclusive - whether scanners contains {@link TRowLock} inside.
* If not, should bring from {@link RowTransaction} or get from HBase directly.
* If not, should bring from {@link HaeinsaRowTransaction} or get from HBase directly.
*/
public ClientScanner(HaeinsaTransaction tx, Iterable<HaeinsaKeyValueScanner> scanners,
Map<byte[], NavigableSet<byte[]>> familyMap, HaeinsaIntraScan intraScan, boolean lockInclusive) {
Expand All @@ -899,7 +898,8 @@ public ClientScanner(HaeinsaTransaction tx, Iterable<HaeinsaKeyValueScanner> sca
* Only can be called one time for every ClientScanner.
* <p>
* The reason why there are different variables for {@link #scannerList} and {@link #scanners} is that
* the way {@link #nextScanner()} implemented is removing {@link HaeinsaKeyValueScanner} one by one form scanners.
* the way {@link #nextScanner(HaeinsaKeyValueScanner)} implemented is removing
* {@link HaeinsaKeyValueScanner} one by one form scanners.
* {@link #close()} method needs to close every {@link ClientScanner} when called,
* so some other variable should preserve every scanner when ClientScanner created.
*/
Expand Down Expand Up @@ -963,7 +963,7 @@ public boolean hasNext() {
}

/**
* Return {@link TRowLock} for specific row from {@link IOException#scanners}.
* Return {@link TRowLock} for specific row from {@link #scanners}.
* Return null if there is no proper {@link TRowLock}.
* <p>
* If one of these {@link #scanners} has row key which is smaller than given row,
Expand Down Expand Up @@ -1269,8 +1269,8 @@ public void close() {
* So {@link #peek()} method or {@link #next()} method will return value from same row.
* <p>
* HBaseGetScanner is now used in two cases.
* First, inside {@link HaeinsaTable#get()}, {@link HaeinsaKeyValue}s returned by this class will
* always have sequenceId of Long.MAX_VALUE.
* First, inside {@link HaeinsaTable#get(HaeinsaTransaction, HaeinsaGet)}, {@link HaeinsaKeyValue}s
* returned by this class will always have sequenceId of Long.MAX_VALUE.
* Second is used inside {@link ClientScanner}. In this case, HBaseGetScanner recover failed transaction and
* get recovered data from HBase.
* Recovered {@link HaeinsaKeyValue} should have smaller sequenceId contained in ClientScanner so far
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ interface HaeinsaTableIfaceInternal extends HaeinsaTableIface {
* {@link ConflictException}.
*
* @throws IOException ConflictException, HBase IOException.
* @throws NullPointException if oldLock is null (haven't read lock from
* HBase)
* @throws NullPointerException if oldLock is null (haven't read lock from HBase)
*/
void checkSingleRowLock(HaeinsaRowTransaction rowState, byte[] row) throws IOException;

Expand All @@ -61,7 +60,7 @@ interface HaeinsaTableIfaceInternal extends HaeinsaTableIface {
* If first mutation in rowState is {@link HaeinsaPut}, then apply consequent Puts in the same RPC which changes lock to
* {@link TRowLockState#PREWRITTEN}.
* Remaining mutations which is not applied with first RPC is remained in {@link TRowLock#mutations}.
* This field will be used in {@link #applyMutations()} stage.
* This field will be used in {@link #applyMutations(HaeinsaRowTransaction, byte[])} stage.
* Columns written in prewritten stage will be recorded in {@link TRowLock#prewritten} field,
* which will be used in {@link HaeinsaTransaction#recover(boolean)} to clean up dirty data
* if transaction failed.
Expand Down Expand Up @@ -134,11 +133,11 @@ interface HaeinsaTableIfaceInternal extends HaeinsaTableIface {

/**
* Delete columns that are prewritten to the specific row during prewritten stage.
* <p>
* Haeinsa can infer prewritten columns to clean up by parsing prewritten field in {@link TRowLock}.
* Should remove column which have {@link TRowLock#currentTimestamp} as timestamp.
* This is possible by using {@link Delete#deleteColumn()} instead of {@link Delete#deleteColumns()}.
* <p>
* Because Haeinsa uses {@link HTableInterface#checkAndDelete()} to delete prewrittens,
* Because Haeinsa uses {@link HTableInterface#checkAndDelete(byte[], byte[], byte[], byte[], Delete)} to delete prewrittens,
* {@link TRowLock} is not changed. It will throw {@link ConflictException} if failed to acquire lock in checkAndDelete.
*
* @throws IOException ConflictException, HBase IOException.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/kr/co/vcnc/haeinsa/HaeinsaTablePool.java
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private void release(HaeinsaTableIface table) throws IOException {
* table pool.
* <p>
* Note: this is a 'shutdown' of the given table pool and different from
* {@link #putTable(HaeinsaTableIface)}, that is used to return the table
* {@link #release(HaeinsaTableIface)}, that is used to return the table
* instance to the pool for future re-use.
*/
public void closeTablePool(final String tableName) throws IOException {
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/kr/co/vcnc/haeinsa/HaeinsaTableTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.util.NavigableMap;

import kr.co.vcnc.haeinsa.thrift.TRowLocks;
import kr.co.vcnc.haeinsa.thrift.generated.TRowLock;

import org.apache.hadoop.hbase.util.Bytes;

Expand Down Expand Up @@ -55,9 +56,9 @@ public HaeinsaTransaction getTransaction() {
* <li>When get {@link HaeinsaRowTransaction} which is already contained in rowStates
* - Should not change {@link HaeinsaRowTransaction#current} manually.</li>
* <li>When rowTransaction is newly created by this method and {@link TRowLock} associated with the row exists
* - Use {@link HaeinsaRowTransaction#setCurrent()} to set current field of rowTransaction.
* - Use {@link HaeinsaRowTransaction#setCurrent(TRowLock)} to set current field of rowTransaction.
* <li>When rowTransaction is newly created by this method and there is no associated {@link TRowLock}</li>
* - Use {@link TRowLocks#serialize(null)} method to set default {@link TRowLock} to current field of rowTransaction.</li>
* - Use {@link TRowLocks#serialize(TRowLock)} method to set default {@link TRowLock} to current field of rowTransaction.</li>
* </ol>
*
* @return RowTransaction - {@link HaeinsaRowTransaction} which contained in
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/kr/co/vcnc/haeinsa/HaeinsaTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* and have reference to {@link HaeinsaTransactionManager} which created this instance.
* <p>
* HaeinsaTransaction can be generated via calling {@link HaeinsaTransactionManager#begin()}
* or {@link HaeinsaTransactionManager#getTransaction()}.
* or {@link HaeinsaTransactionManager#getTransaction(byte[], byte[])}.
* Former is used when start new transaction, later is used when try to roll back or retry failed transaction.
* <p>
* One {@link HaeinsaTransaction} can't be used after calling {@link #commit()} or {@link #rollback()} is called.
Expand Down Expand Up @@ -166,7 +166,7 @@ HaeinsaTransactionLocals getLocals() {
/**
* Bring {@link HaeinsaTableTransaction} which have name of tableName.
* If there is no {@link HaeinsaTableTransaction} have this name,
* then create one instance for it and save inside {@link #tableStates} and return.
* then create one instance for it and save inside {@link #txStates} and return.
*
* @return instance of {@link HaeinsaTableTransaction}
*/
Expand Down Expand Up @@ -272,7 +272,7 @@ public void commit() throws IOException {
}

/**
* Use {@link HaeinsaTable#checkSingleRowLock()} to check RowLock on HBase
* Use {@link HaeinsaTable#checkSingleRowLock(HaeinsaRowTransaction, byte[])} to check RowLock on HBase
* of read-only rows of tx. If all lock-checking by get was success,
* read-only tx was success. Throws ConflictException otherwise.
*
Expand Down Expand Up @@ -371,7 +371,7 @@ private void commitMultiRowsMutation() throws IOException {
* 1. In case of {@link #commitMultiRowsMutation()}, after changing primary row to
* {@link TRowLockState#COMMITTED} and applying all mutations in primary row and secondary rows.
* <p>
* 2. When try to {@link #recover()} failed transaction in the middle of execution.
* 2. When try to {@link #recover(boolean)} failed transaction in the middle of execution.
* This method should be called only when primary row is in the state of {@link TRowLockState#COMMITTED}.
*
* @throws IOException ConflictException, HBase IOException.
Expand Down Expand Up @@ -417,7 +417,7 @@ private void makeStable() throws IOException {
}

/**
* Reload information of failed transaction and complete it by calling {@link #makStable()}
* Reload information of failed transaction and complete it by calling {@link #makeStable()}
* if already completed one, ( when primaryRow have {@link TRowLockState#COMMITTED} state }
* or abort by calling {@link #abort()} otherwise.
*
Expand Down Expand Up @@ -467,7 +467,7 @@ protected void recover(boolean ignoreExpiry) throws IOException {
* <p>
* Aborting is executed by following order.
* <ol>
* <li>Abort primary row by calling {@link HaeinsaTableIfaceInternal#abortPrimary()}.</li>
* <li>Abort primary row by calling {@link HaeinsaTableIfaceInternal#abortPrimary(HaeinsaRowTransaction, byte[])}.</li>
* <li>Visit all secondary rows and change from prewritten to stable state.
* Prewritten data on rows are removed at this state.</li>
* <li>Change primary row to stable state.</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ private void checkDanglingRowLockOrThrow(byte[] tableName, byte[] row, TRowLock

/**
* Recover TRowLocks of failed HaeinsaTransaction from primary row on HBase.
* Transaction information about secondary rows are recovered with {@link #addSecondaryRowLock()}.
* Transaction information about secondary rows are recovered with
* {@link #addSecondaryRowLock(HaeinsaTransaction, TRowKey, TRowLock, TRowKey)}.
* HaeinsaTransaction made by this method do not assign proper values on mutations variable.
*/
private HaeinsaTransaction getTransactionFromPrimary(TRowKey rowKey, TRowLock primaryRowLock) throws IOException {
Expand All @@ -194,7 +195,7 @@ private HaeinsaTransaction getTransactionFromPrimary(TRowKey rowKey, TRowLock pr
* Secondary row is not included in recovered transaction neither when commitTimestamp is different with primary row's,
* because it implicates that the row is locked by other transaction.
* <p>
* As similar to {@link #getTransactionFromPrimary()}, rowTransaction added by this method do not have
* As similar to {@link #getTransactionFromPrimary(TRowKey, TRowLock)}, rowTransaction added by this method do not have
* proper mutations variable.
*/
private void addSecondaryRowLock(HaeinsaTransaction transaction, TRowKey primaryRowKey,
Expand Down

0 comments on commit 19ea6f0

Please sign in to comment.