@@ -57,10 +57,9 @@ public class TypedTable<KEY, VALUE> implements Table<KEY, VALUE> {
5757 static final int BUFFER_SIZE_DEFAULT = 4 << 10 ; // 4 KB
5858
5959 private final RDBTable rawTable ;
60+ private final String info ;
6061
61- private final Class <KEY > keyType ;
6262 private final Codec <KEY > keyCodec ;
63- private final Class <VALUE > valueType ;
6463 private final Codec <VALUE > valueCodec ;
6564
6665 private final boolean supportCodecBuffer ;
@@ -72,11 +71,9 @@ public class TypedTable<KEY, VALUE> implements Table<KEY, VALUE> {
7271 * The same as this(rawTable, codecRegistry, keyType, valueType,
7372 * CacheType.PARTIAL_CACHE).
7473 */
75- public TypedTable (RDBTable rawTable ,
76- CodecRegistry codecRegistry , Class <KEY > keyType ,
77- Class <VALUE > valueType ) throws IOException {
78- this (rawTable , codecRegistry , keyType , valueType ,
79- CacheType .PARTIAL_CACHE , "" );
74+ TypedTable (RDBTable rawTable , CodecRegistry codecRegistry , Class <KEY > keyType , Class <VALUE > valueType )
75+ throws IOException {
76+ this (rawTable , codecRegistry , keyType , valueType , CacheType .PARTIAL_CACHE );
8077 }
8178
8279 /**
@@ -87,27 +84,28 @@ public TypedTable(RDBTable rawTable,
8784 * @param keyType The key type.
8885 * @param valueType The value type.
8986 * @param cacheType How to cache the entries?
90- * @param threadNamePrefix
9187 * @throws IOException if failed to iterate the raw table.
9288 */
93- public TypedTable (RDBTable rawTable ,
94- CodecRegistry codecRegistry , Class <KEY > keyType ,
95- Class <VALUE > valueType ,
96- CacheType cacheType , String threadNamePrefix ) throws IOException {
89+ TypedTable (RDBTable rawTable , CodecRegistry codecRegistry , Class <KEY > keyType , Class <VALUE > valueType ,
90+ CacheType cacheType ) throws IOException {
9791 this .rawTable = Objects .requireNonNull (rawTable , "rawTable==null" );
9892 Objects .requireNonNull (codecRegistry , "codecRegistry == null" );
9993
100- this . keyType = Objects .requireNonNull (keyType , "keyType == null" );
94+ Objects .requireNonNull (keyType , "keyType == null" );
10195 this .keyCodec = codecRegistry .getCodecFromClass (keyType );
10296 Objects .requireNonNull (keyCodec , "keyCodec == null" );
10397
104- this . valueType = Objects .requireNonNull (valueType , "valueType == null" );
98+ Objects .requireNonNull (valueType , "valueType == null" );
10599 this .valueCodec = codecRegistry .getCodecFromClass (valueType );
106100 Objects .requireNonNull (valueCodec , "valueCodec == null" );
107101
102+ this .info = getClassSimpleName (getClass ()) + "-" + getName ()
103+ + "(" + getClassSimpleName (keyType ) + "->" + getClassSimpleName (valueType ) + ")" ;
104+
108105 this .supportCodecBuffer = keyCodec .supportCodecBuffer ()
109106 && valueCodec .supportCodecBuffer ();
110107
108+ final String threadNamePrefix = rawTable .getName () + "_" ;
111109 if (cacheType == CacheType .FULL_CACHE ) {
112110 cache = new FullTableCache <>(threadNamePrefix );
113111 //fill cache
@@ -443,9 +441,7 @@ public String getName() {
443441
444442 @ Override
445443 public String toString () {
446- return getClassSimpleName (getClass ()) + "-" + getName ()
447- + "(" + getClassSimpleName (keyType )
448- + "->" + getClassSimpleName (valueType ) + ")" ;
444+ return info ;
449445 }
450446
451447 @ Override
@@ -572,14 +568,6 @@ public KEY getKey() throws IOException {
572568 public VALUE getValue () throws IOException {
573569 return decodeValue (rawKeyValue .getValue ());
574570 }
575-
576- public byte [] getRawKey () throws IOException {
577- return rawKeyValue .getKey ();
578- }
579-
580- public byte [] getRawValue () throws IOException {
581- return rawKeyValue .getValue ();
582- }
583571 }
584572
585573 RawIterator <CodecBuffer > newCodecBufferTableIterator (
0 commit comments