2525import java .util .regex .Matcher ;
2626import java .util .regex .Pattern ;
2727
28+ import com .sun .istack .Nullable ;
2829import org .apache .hadoop .conf .Configuration ;
2930import org .apache .hadoop .fs .FileStatus ;
3031import org .apache .hadoop .fs .FileSystem ;
@@ -111,11 +112,11 @@ public class StoreFileInfo {
111112 */
112113 public StoreFileInfo (final Configuration conf , final FileSystem fs , final Path initialPath )
113114 throws IOException {
114- this (conf , fs , initialPath , null , null );
115+ this (conf , fs , null , initialPath );
115116 }
116117
117- private StoreFileInfo (final Configuration conf , final FileSystem fs , final Path initialPath ,
118- final Long createdTimestamp , final Long size ) throws IOException {
118+ private StoreFileInfo (final Configuration conf , final FileSystem fs ,
119+ @ Nullable final FileStatus fileStatus , final Path initialPath ) throws IOException {
119120 assert fs != null ;
120121 assert initialPath != null ;
121122 assert conf != null ;
@@ -143,13 +144,13 @@ private StoreFileInfo(final Configuration conf, final FileSystem fs, final Path
143144 " reference to " + referencePath );
144145 } else if (isHFile (p )) {
145146 // HFile
146- if (createdTimestamp != null && size != null ) {
147- this .createdTimestamp = createdTimestamp ;
148- this .size = size ;
149- } else {
150- FileStatus fileStatus = fs .getFileStatus (initialPath );
147+ if (fileStatus != null ) {
151148 this .createdTimestamp = fileStatus .getModificationTime ();
152149 this .size = fileStatus .getLen ();
150+ } else {
151+ FileStatus fStatus = fs .getFileStatus (initialPath );
152+ this .createdTimestamp = fStatus .getModificationTime ();
153+ this .size = fStatus .getLen ();
153154 }
154155 this .reference = null ;
155156 this .link = null ;
@@ -166,7 +167,7 @@ private StoreFileInfo(final Configuration conf, final FileSystem fs, final Path
166167 */
167168 public StoreFileInfo (final Configuration conf , final FileSystem fs , final FileStatus fileStatus )
168169 throws IOException {
169- this (conf , fs , fileStatus . getPath () , fileStatus .getModificationTime (), fileStatus . getLen ());
170+ this (conf , fs , fileStatus , fileStatus .getPath ());
170171 }
171172
172173 /**
0 commit comments