@@ -93,7 +93,6 @@ public class HMobStore extends HStore {
93
93
private AtomicLong mobFlushedCellsSize = new AtomicLong ();
94
94
private AtomicLong mobScanCellsCount = new AtomicLong ();
95
95
private AtomicLong mobScanCellsSize = new AtomicLong ();
96
- private ColumnFamilyDescriptor family ;
97
96
private Map <String , List <Path >> map = new ConcurrentHashMap <>();
98
97
private final IdLock keyLock = new IdLock ();
99
98
// When we add a MOB reference cell to the HFile, we will add 2 tags along with it
@@ -107,11 +106,10 @@ public class HMobStore extends HStore {
107
106
public HMobStore (final HRegion region , final ColumnFamilyDescriptor family ,
108
107
final Configuration confParam , boolean warmup ) throws IOException {
109
108
super (region , family , confParam , warmup );
110
- this .family = family ;
111
109
this .mobFileCache = region .getMobFileCache ();
112
110
this .homePath = MobUtils .getMobHome (conf );
113
111
this .mobFamilyPath = MobUtils .getMobFamilyPath (conf , this .getTableName (),
114
- family .getNameAsString ());
112
+ family .getNameAsString ());
115
113
List <Path > locations = new ArrayList <>(2 );
116
114
locations .add (mobFamilyPath );
117
115
TableName tn = region .getTableDescriptor ().getTableName ();
@@ -248,9 +246,11 @@ public StoreFileWriter createWriterInTmp(String date, Path basePath, long maxKey
248
246
public StoreFileWriter createWriterInTmp (MobFileName mobFileName , Path basePath ,
249
247
long maxKeyCount , Compression .Algorithm compression ,
250
248
boolean isCompaction ) throws IOException {
251
- return MobUtils .createWriter (conf , region .getFilesystem (), family ,
252
- new Path (basePath , mobFileName .getFileName ()), maxKeyCount , compression , cacheConf ,
253
- cryptoContext , checksumType , bytesPerChecksum , blocksize , BloomType .NONE , isCompaction );
249
+ return MobUtils .createWriter (conf , getFileSystem (), getColumnFamilyDescriptor (),
250
+ new Path (basePath , mobFileName .getFileName ()), maxKeyCount , compression , getCacheConfig (),
251
+ getStoreContext ().getEncryptionContext (), StoreUtils .getChecksumType (conf ),
252
+ StoreUtils .getBytesPerChecksum (conf ), getStoreContext ().getBlockSize (), BloomType .NONE ,
253
+ isCompaction );
254
254
}
255
255
256
256
/**
@@ -268,10 +268,10 @@ public void commitFile(final Path sourceFile, Path targetPath) throws IOExceptio
268
268
String msg = "Renaming flushed file from " + sourceFile + " to " + dstPath ;
269
269
LOG .info (msg );
270
270
Path parent = dstPath .getParent ();
271
- if (!region . getFilesystem ().exists (parent )) {
272
- region . getFilesystem ().mkdirs (parent );
271
+ if (!getFileSystem ().exists (parent )) {
272
+ getFileSystem ().mkdirs (parent );
273
273
}
274
- if (!region . getFilesystem ().rename (sourceFile , dstPath )) {
274
+ if (!getFileSystem ().rename (sourceFile , dstPath )) {
275
275
throw new IOException ("Failed rename of " + sourceFile + " to " + dstPath );
276
276
}
277
277
}
@@ -284,7 +284,7 @@ public void commitFile(final Path sourceFile, Path targetPath) throws IOExceptio
284
284
private void validateMobFile (Path path ) throws IOException {
285
285
HStoreFile storeFile = null ;
286
286
try {
287
- storeFile = new HStoreFile (region . getFilesystem (), path , conf , this . cacheConf ,
287
+ storeFile = new HStoreFile (getFileSystem (), path , conf , getCacheConfig () ,
288
288
BloomType .NONE , isPrimaryReplicaStore ());
289
289
storeFile .initReader ();
290
290
} catch (IOException e ) {
@@ -335,9 +335,9 @@ public MobCell resolve(Cell reference, boolean cacheBlocks, long readPt,
335
335
if (locations == null ) {
336
336
locations = new ArrayList <>(2 );
337
337
TableName tn = TableName .valueOf (tableNameString );
338
- locations .add (MobUtils .getMobFamilyPath (conf , tn , family . getNameAsString ()));
338
+ locations .add (MobUtils .getMobFamilyPath (conf , tn , getColumnFamilyName ()));
339
339
locations .add (HFileArchiveUtil .getStoreArchivePath (conf , tn ,
340
- MobUtils .getMobRegionInfo (tn ).getEncodedName (), family . getNameAsString ()));
340
+ MobUtils .getMobRegionInfo (tn ).getEncodedName (), getColumnFamilyName ()));
341
341
map .put (tableNameString , locations );
342
342
}
343
343
} finally {
@@ -390,7 +390,7 @@ private MobCell readCell(List<Path> locations, String fileName, Cell search,
390
390
MobFile file = null ;
391
391
Path path = new Path (location , fileName );
392
392
try {
393
- file = mobFileCache .openFile (fs , path , cacheConf );
393
+ file = mobFileCache .openFile (fs , path , getCacheConfig () );
394
394
return readPt != -1 ? file .readCell (search , cacheMobBlocks , readPt )
395
395
: file .readCell (search , cacheMobBlocks );
396
396
} catch (IOException e ) {
0 commit comments