6969import org .apache .hadoop .ozone .recon .ReconUtils ;
7070import org .apache .hadoop .ozone .recon .api .handlers .BucketHandler ;
7171import org .apache .hadoop .ozone .recon .api .types .KeyEntityInfo ;
72- import org .apache .hadoop .ozone .recon .api .types .KeyEntityInfoProtoWrapper ;
7372import org .apache .hadoop .ozone .recon .api .types .KeyInsightInfoResponse ;
7473import org .apache .hadoop .ozone .recon .api .types .ListKeysResponse ;
7574import org .apache .hadoop .ozone .recon .api .types .NSSummary ;
7675import org .apache .hadoop .ozone .recon .api .types .ParamInfo ;
76+ import org .apache .hadoop .ozone .recon .api .types .ReconBasicOmKeyInfo ;
7777import org .apache .hadoop .ozone .recon .api .types .ResponseStatus ;
7878import org .apache .hadoop .ozone .recon .recovery .ReconOMMetadataManager ;
7979import org .apache .hadoop .ozone .recon .spi .impl .ReconNamespaceSummaryManagerImpl ;
@@ -1014,7 +1014,7 @@ public Response listKeys(@QueryParam("replicationType") String replicationType,
10141014 listKeysResponse = (ListKeysResponse ) response .getEntity ();
10151015 }
10161016
1017- List <KeyEntityInfoProtoWrapper > keyInfoList = listKeysResponse .getKeys ();
1017+ List <ReconBasicOmKeyInfo > keyInfoList = listKeysResponse .getKeys ();
10181018 if (!keyInfoList .isEmpty ()) {
10191019 listKeysResponse .setLastKey (keyInfoList .get (keyInfoList .size () - 1 ).getKey ());
10201020 }
@@ -1029,9 +1029,9 @@ private Response getListKeysResponse(ParamInfo paramInfo) {
10291029 long replicatedTotal = 0 ;
10301030 long unreplicatedTotal = 0 ;
10311031
1032- // Search keys from non-FSO layout.
1033- Table < String , KeyEntityInfoProtoWrapper > keyTable =
1034- omMetadataManager . getKeyTableLite ( BucketLayout . LEGACY );
1032+ Table < String , ReconBasicOmKeyInfo > keyTable =
1033+ omMetadataManager . getKeyTableBasic ( BucketLayout . LEGACY );
1034+
10351035 retrieveKeysFromTable (keyTable , paramInfo , listKeysResponse .getKeys ());
10361036
10371037 // Search keys from FSO layout.
@@ -1042,7 +1042,7 @@ private Response getListKeysResponse(ParamInfo paramInfo) {
10421042 return ReconResponseUtils .noMatchedKeysResponse (paramInfo .getStartPrefix ());
10431043 }
10441044
1045- for (KeyEntityInfoProtoWrapper keyEntityInfo : listKeysResponse .getKeys ()) {
1045+ for (ReconBasicOmKeyInfo keyEntityInfo : listKeysResponse .getKeys ()) {
10461046 replicatedTotal += keyEntityInfo .getReplicatedSize ();
10471047 unreplicatedTotal += keyEntityInfo .getSize ();
10481048 }
@@ -1067,13 +1067,14 @@ private Response getListKeysResponse(ParamInfo paramInfo) {
10671067 }
10681068 }
10691069
1070- public void searchKeysInFSO (ParamInfo paramInfo , List <KeyEntityInfoProtoWrapper > results )
1070+ public void searchKeysInFSO (ParamInfo paramInfo , List <ReconBasicOmKeyInfo > results )
10711071 throws IOException {
10721072 // Convert the search prefix to an object path for FSO buckets
10731073 String startPrefixObjectPath = convertStartPrefixPathToObjectIdPath (paramInfo .getStartPrefix ());
10741074 String [] names = parseRequestPath (startPrefixObjectPath );
1075- Table <String , KeyEntityInfoProtoWrapper > fileTable =
1076- omMetadataManager .getKeyTableLite (BucketLayout .FILE_SYSTEM_OPTIMIZED );
1075+
1076+ Table <String , ReconBasicOmKeyInfo > fileTable =
1077+ omMetadataManager .getKeyTableBasic (BucketLayout .FILE_SYSTEM_OPTIMIZED );
10771078
10781079 // If names.length > 2, then the search prefix is at the level above bucket level hence
10791080 // no need to find parent or extract id's or find subpaths as the fileTable is
@@ -1181,16 +1182,16 @@ public String convertStartPrefixPathToObjectIdPath(String startPrefixPath)
11811182 * @throws IOException If there are problems accessing the table.
11821183 */
11831184 private void retrieveKeysFromTable (
1184- Table <String , KeyEntityInfoProtoWrapper > table , ParamInfo paramInfo , List <KeyEntityInfoProtoWrapper > results )
1185+ Table <String , ReconBasicOmKeyInfo > table , ParamInfo paramInfo , List <ReconBasicOmKeyInfo > results )
11851186 throws IOException {
11861187 boolean skipPrevKey = false ;
11871188 String seekKey = paramInfo .getPrevKey ();
11881189 try (
1189- TableIterator <String , ? extends Table .KeyValue <String , KeyEntityInfoProtoWrapper >> keyIter = table .iterator ()) {
1190+ TableIterator <String , ? extends Table .KeyValue <String , ReconBasicOmKeyInfo >> keyIter = table .iterator ()) {
11901191
11911192 if (!paramInfo .isSkipPrevKeyDone () && isNotBlank (seekKey )) {
11921193 skipPrevKey = true ;
1193- Table .KeyValue <String , KeyEntityInfoProtoWrapper > seekKeyValue =
1194+ Table .KeyValue <String , ReconBasicOmKeyInfo > seekKeyValue =
11941195 keyIter .seek (seekKey );
11951196
11961197 // check if RocksDB was able to seek correctly to the given key prefix
@@ -1207,7 +1208,7 @@ private void retrieveKeysFromTable(
12071208 StringBuilder keyPrefix = null ;
12081209 int keyPrefixLength = 0 ;
12091210 while (keyIter .hasNext ()) {
1210- Table .KeyValue <String , KeyEntityInfoProtoWrapper > entry = keyIter .next ();
1211+ Table .KeyValue <String , ReconBasicOmKeyInfo > entry = keyIter .next ();
12111212 String dbKey = entry .getKey ();
12121213 if (!dbKey .startsWith (paramInfo .getStartPrefix ())) {
12131214 break ; // Exit the loop if the key no longer matches the prefix
@@ -1217,7 +1218,7 @@ private void retrieveKeysFromTable(
12171218 continue ;
12181219 }
12191220 if (applyFilters (entry , paramInfo )) {
1220- KeyEntityInfoProtoWrapper keyEntityInfo = entry .getValue ();
1221+ ReconBasicOmKeyInfo keyEntityInfo = entry .getValue ();
12211222 keyEntityInfo .setKey (dbKey );
12221223 if (keyEntityInfo .getParentId () == 0 ) {
12231224 // Legacy bucket keys have a parentID of zero. OBS bucket keys have a parentID of the bucketID.
@@ -1258,7 +1259,7 @@ private void retrieveKeysFromTable(
12581259 }
12591260 }
12601261
1261- private boolean applyFilters (Table .KeyValue <String , KeyEntityInfoProtoWrapper > entry , ParamInfo paramInfo )
1262+ private boolean applyFilters (Table .KeyValue <String , ReconBasicOmKeyInfo > entry , ParamInfo paramInfo )
12621263 throws IOException {
12631264
12641265 LOG .debug ("Applying filters on : {}" , entry .getKey ());
0 commit comments