@Test public void testHashCode() { TableSplit split1 = new TableSplit(TableName.valueOf("table"), "row-start".getBytes(), "row-end".getBytes(), "location"); TableSplit split2 = new TableSplit(TableName.valueOf("table"), "row-start".getBytes(), "row-end".getBytes(), "location"); assertEquals (split1, split2); assertTrue (split1.hashCode() == split2.hashCode()); HashSet<TableSplit> set = new HashSet<TableSplit>(2); set.add(split1); set.add(split2); assertTrue(set.size() == 1); }
@Override public int hashCode() { int result = tableName != null ? tableName.hashCode() : 0; result = 31 * result + (scan != null ? scan.hashCode() : 0); result = 31 * result + (startRow != null ? Arrays.hashCode(startRow) : 0); result = 31 * result + (endRow != null ? Arrays.hashCode(endRow) : 0); result = 31 * result + (regionLocation != null ? regionLocation.hashCode() : 0); return result; }
TableSplit extends InputSplit implements Writable, Comparable<TableSplit> { @Override public int hashCode() { int result = tableName != null ? tableName.hashCode() : 0; result = 31 * result + (scan != null ? scan.hashCode() : 0); result = 31 * result + (startRow != null ? Arrays.hashCode(startRow) : 0); result = 31 * result + (endRow != null ? Arrays.hashCode(endRow) : 0); result = 31 * result + (regionLocation != null ? regionLocation.hashCode() : 0); return result; } }
TableSplit extends InputSplit implements Writable, Comparable<TableSplit> { @Override public int hashCode() { int result = tableName != null ? tableName.hashCode() : 0; result = 31 * result + (scan != null ? scan.hashCode() : 0); result = 31 * result + (startRow != null ? Arrays.hashCode(startRow) : 0); result = 31 * result + (endRow != null ? Arrays.hashCode(endRow) : 0); result = 31 * result + (regionLocation != null ? regionLocation.hashCode() : 0); return result; } TableSplit(); @Deprecated  TableSplit(final byte [] tableName, Scan scan, byte [] startRow, byte [] endRow,
      final String location);  TableSplit(TableName tableName, Scan scan, byte [] startRow, byte [] endRow,
                    final String location);  TableSplit(TableName tableName, Scan scan, byte [] startRow, byte [] endRow,
      final String location, long length); @Deprecated  TableSplit(final byte [] tableName, byte[] startRow, byte[] endRow,
      final String location);  TableSplit(TableName tableName, byte[] startRow, byte[] endRow,
      final String location);  TableSplit(TableName tableName, byte[] startRow, byte[] endRow,
                    final String location, long length); }
TableSplit extends InputSplit implements Writable, Comparable<TableSplit> { @Override public int hashCode() { int result = tableName != null ? tableName.hashCode() : 0; result = 31 * result + (scan != null ? scan.hashCode() : 0); result = 31 * result + (startRow != null ? Arrays.hashCode(startRow) : 0); result = 31 * result + (endRow != null ? Arrays.hashCode(endRow) : 0); result = 31 * result + (regionLocation != null ? regionLocation.hashCode() : 0); return result; } TableSplit(); @Deprecated  TableSplit(final byte [] tableName, Scan scan, byte [] startRow, byte [] endRow,
      final String location);  TableSplit(TableName tableName, Scan scan, byte [] startRow, byte [] endRow,
                    final String location);  TableSplit(TableName tableName, Scan scan, byte [] startRow, byte [] endRow,
      final String location, long length); @Deprecated  TableSplit(final byte [] tableName, byte[] startRow, byte[] endRow,
      final String location);  TableSplit(TableName tableName, byte[] startRow, byte[] endRow,
      final String location);  TableSplit(TableName tableName, byte[] startRow, byte[] endRow,
                    final String location, long length); Scan getScan(); byte [] getTableName(); TableName getTable(); byte [] getStartRow(); byte [] getEndRow(); String getRegionLocation(); @Override String[] getLocations(); @Override long getLength(); @Override void readFields(DataInput in); @Override void write(DataOutput out); @Override String toString(); @Override int compareTo(TableSplit split); @Override boolean equals(Object o); @Override int hashCode(); }
TableSplit extends InputSplit implements Writable, Comparable<TableSplit> { @Override public int hashCode() { int result = tableName != null ? tableName.hashCode() : 0; result = 31 * result + (scan != null ? scan.hashCode() : 0); result = 31 * result + (startRow != null ? Arrays.hashCode(startRow) : 0); result = 31 * result + (endRow != null ? Arrays.hashCode(endRow) : 0); result = 31 * result + (regionLocation != null ? regionLocation.hashCode() : 0); return result; } TableSplit(); @Deprecated  TableSplit(final byte [] tableName, Scan scan, byte [] startRow, byte [] endRow,
      final String location);  TableSplit(TableName tableName, Scan scan, byte [] startRow, byte [] endRow,
                    final String location);  TableSplit(TableName tableName, Scan scan, byte [] startRow, byte [] endRow,
      final String location, long length); @Deprecated  TableSplit(final byte [] tableName, byte[] startRow, byte[] endRow,
      final String location);  TableSplit(TableName tableName, byte[] startRow, byte[] endRow,
      final String location);  TableSplit(TableName tableName, byte[] startRow, byte[] endRow,
                    final String location, long length); Scan getScan(); byte [] getTableName(); TableName getTable(); byte [] getStartRow(); byte [] getEndRow(); String getRegionLocation(); @Override String[] getLocations(); @Override long getLength(); @Override void readFields(DataInput in); @Override void write(DataOutput out); @Override String toString(); @Override int compareTo(TableSplit split); @Override boolean equals(Object o); @Override int hashCode(); static final Log LOG; }