Skip to content

Commit

Permalink
[ISSUE-4313] Add @OverRide for override method of processing module (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
xubo245 authored Jul 8, 2023
1 parent 6e031c0 commit 8264b3b
Show file tree
Hide file tree
Showing 24 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public String getLocalizedMessage() {
/**
* getMessage
*/
@Override
public String getMessage() {
return this.msg;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public void setFilePath(String filePath) {
this.filePath = filePath;
}

@Override
public String[] getLocations() {
return locations;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public BadRecordFoundException(String msg, Throwable t) {
/**
* getMessage
*/
@Override
public String getMessage() {
return this.msg;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public String getLocalizedMessage() {
/**
* getMessage
*/
@Override
public String getMessage() {
return this.msg;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public NoRetryException(String msg) {
/**
* getMessage
*/
@Override
public String getMessage() {
return this.msg;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ private IntegralHash(int index) {
this.index = index;
}

@Override
public int getHash(Object[] value) {
return value[index] != null ? Long.valueOf(value[index].toString()).hashCode() : 0;
}
Expand All @@ -88,6 +89,7 @@ private DecimalHash(int index) {
this.index = index;
}

@Override
public int getHash(Object[] value) {
return value[index] != null ? Double.valueOf(value[index].toString()).hashCode() : 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ private IntegralHash(int index) {
this.index = index;
}

@Override
public int getHash(Object[] value) {
if (value[index] == null) {
return 42;
Expand All @@ -113,6 +114,7 @@ private LongHash(int index) {
this.index = index;
}

@Override
public int getHash(Object[] value) {
if (value[index] == null) {
return 42;
Expand All @@ -135,6 +137,7 @@ private TimestampHash(int index) {
this.index = index;
}

@Override
public int getHash(Object[] value) {
if (value[index] == null) {
return 42;
Expand All @@ -153,6 +156,7 @@ private DecimalHash(int index) {
this.index = index;
}

@Override
public int getHash(Object[] value) {
if (value[index] == null) {
return 42;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public UnsafeRowComparator(UnsafeCarbonRowPage rowPage) {
/**
* Below method will be used to compare two mdkey
*/
@Override
public int compare(UnsafeCarbonRow rowL, UnsafeCarbonRow rowR) {
return compare(rowL, baseObject, rowR, baseObject);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public UnsafeRowComparatorForNormalDims(UnsafeCarbonRowPage rowPage) {
/**
* Below method will be used to compare two mdkey
*/
@Override
public int compare(UnsafeCarbonRow rowL, UnsafeCarbonRow rowR) {
int diff = 0;
long rowA = rowL.address;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,21 @@ public UnsafeFinalMergePageHolder(UnsafeInMemoryIntermediateDataMerger merger,
tableFieldStat.getDictSortColIdxSchemaOrderMapping());
}

@Override
public boolean hasNext() {
if (counter < actualSize) {
return true;
}
return false;
}

@Override
public void readRow() {
currentRow = rowPages[rowPageIndexes[counter]].getRow(mergedAddresses[counter]);
counter++;
}

@Override
public IntermediateSortTempRow getRow() {
return currentRow;
}
Expand Down Expand Up @@ -107,10 +110,12 @@ public int hashCode() {
return super.hashCode();
}

@Override
public int numberOfRows() {
return actualSize;
}

@Override
public void close() {
for (int i = 0; i < rowPages.length; i++) {
rowPages[i].freeMemory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,22 @@ public UnsafeInmemoryHolder(UnsafeCarbonRowPage rowPage) {
this.rowPage.setReadConvertedNoSortField();
}

@Override
public boolean hasNext() {
if (counter < actualSize) {
return true;
}
return false;
}

@Override
public void readRow() {
address = rowPage.getBuffer().get(counter);
currentRow = rowPage.getRow(address + rowPage.getDataBlock().getBaseOffset());
counter++;
}

@Override
public IntermediateSortTempRow getRow() {
return currentRow;
}
Expand Down Expand Up @@ -97,10 +100,12 @@ public int hashCode() {
return super.hashCode();
}

@Override
public int numberOfRows() {
return actualSize;
}

@Override
public void close() {
rowPage.freeMemory();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ private IntermediateSortTempRow[] readBatchedRowFromStream(int expected)
*
* @return row
*/
@Override
public IntermediateSortTempRow getRow() {
return this.returnRow;
}
Expand All @@ -264,6 +265,7 @@ public IntermediateSortTempRow getRow() {
*
* @return more row present in file
*/
@Override
public boolean hasNext() {
if (prefetch) {
return this.prefetchRecordsProceesed < this.entryCount;
Expand All @@ -274,6 +276,7 @@ public boolean hasNext() {
/**
* Below method will be used to close streams
*/
@Override
public void close() {
CarbonUtil.closeStreams(stream);
if (null != executorService && !executorService.isShutdown()) {
Expand All @@ -286,6 +289,7 @@ public void close() {
*
* @return entryCount
*/
@Override
public int numberOfRows() {
return entryCount;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ private List<File> getFilesToMergeSort() {
final int rangeId = parameters.getRangeId();

FileFilter fileFilter = new FileFilter() {
@Override
public boolean accept(File pathname) {
return pathname.getName().startsWith(tableName + '_' + rangeId);
}
Expand Down Expand Up @@ -196,6 +197,7 @@ private void createRecordHolderQueue() {
*
* @return sorted row
*/
@Override
public Object[] next() {
if (hasNext()) {
return sortStepRowHandler.convertIntermediateSortTempRowTo3Parted(getSortedRecordFromFile());
Expand Down Expand Up @@ -255,6 +257,7 @@ private IntermediateSortTempRow getSortedRecordFromFile() throws CarbonDataWrite
*
* @return more element is present
*/
@Override
public boolean hasNext() {
return this.fileCounter > 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public CompactionResultSortProcessor(CarbonLoadModel carbonLoadModel, CarbonTabl
* @return if the compaction is success or not
* @throws Exception
*/
@Override
public boolean execute(List<RawResultIterator> unsortedResultIteratorList,
List<RawResultIterator> sortedResultIteratorList) throws Exception {
boolean isCompactionSuccess = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ private void initRecordHolderHeap(List<RawResultIterator> rawResultIteratorList)
* Merge function
*
*/
@Override
public boolean execute(List<RawResultIterator> unsortedResultIteratorList,
List<RawResultIterator> sortedResultIteratorList) throws Exception {
List<RawResultIterator> finalIteratorList = new ArrayList<>(unsortedResultIteratorList);

This comment has been minimized.

Copy link
@Chizhiwen160

Chizhiwen160 Sep 10, 2023

Ysh

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public String getLocalizedMessage() {
/**
* getMessage
*/
@Override
public String getMessage() {
return this.msg;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public void initialise() {
* 2. Convert it to IntermediateSortTempRow
* 3. Store it in memory to read through getRow() method
*/
@Override
public void readRow() {
Object[] row = this.rawResultIterator.next();
//TODO add code to get directly Object[] Instead Of CarbonRow Object
Expand All @@ -88,6 +89,7 @@ public void readRow() {

}

@Override
public int getEntryCount() {
// this will not be used for intermediate sorting
throw new UnsupportedOperationException("Operation Not supported");
Expand All @@ -99,6 +101,7 @@ public int getEntryCount() {
*
* @return more row present in file
*/
@Override
public boolean hasNext() {
return this.rawResultIterator.hasNext();
}
Expand All @@ -118,6 +121,7 @@ public int hashCode() {
/**
* Below method will be used to close streams
*/
@Override
public void closeStream() {
rawResultIterator.close();
}
Expand All @@ -126,6 +130,7 @@ public void closeStream() {
*
* @return row
*/
@Override
public IntermediateSortTempRow getRow() {
return returnRow;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public IntermediateSortTempRowComparator(boolean[] isSortColumnNoDictionary,
/**
* Below method will be used to compare two sort temp row
*/
@Override
public int compare(IntermediateSortTempRow rowA, IntermediateSortTempRow rowB) {
int diff = 0;
int dictIndex = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public NewRowComparator(boolean[] noDicSortColumnMapping,
/**
* Below method will be used to compare two mdkey
*/
@Override
public int compare(Object[] rowA, Object[] rowB) {
int diff = 0;
int index = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public NewRowComparatorForNormalDims(int numberOfSortColumns) {
*
* @see Comparator#compare(Object, Object)
*/
@Override
public int compare(Object[] rowA, Object[] rowB) {
int diff = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public void addInMemoryRawResultIterator(List<RawResultIterator> sortedRawResult
private List<File> getFilesToMergeSort() {
final int rangeId = sortParameters.getRangeId();
FileFilter fileFilter = new FileFilter() {
@Override
public boolean accept(File pathname) {
return pathname.getName().startsWith(tableName + '_' + rangeId);
}
Expand Down Expand Up @@ -246,6 +247,7 @@ private synchronized void notifyFailure(Throwable throwable) {
* @return sorted row
* @throws CarbonSortKeyAndGroupByException
*/
@Override
public Object[] next() {
if (hasNext()) {
IntermediateSortTempRow sortTempRow = getSortedRecordFromFile();
Expand Down Expand Up @@ -305,10 +307,12 @@ private IntermediateSortTempRow getSortedRecordFromFile() throws CarbonDataWrite
*
* @return more element is present
*/
@Override
public boolean hasNext() {
return this.recordHolderHeapLocal != null && this.recordHolderHeapLocal.size() > 0;
}

@Override
public void close() {
if (null != executorService && !executorService.isShutdown()) {
executorService.shutdownNow();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ private void setComplexMapSurrogateIndex(int dimensionCount) {
*
* @throws CarbonDataWriterException
*/
@Override
public void initialise() throws CarbonDataWriterException {
setWritingConfiguration();
}
Expand All @@ -216,6 +217,7 @@ public void initialise() throws CarbonDataWriterException {
* @param row
* @throws CarbonDataWriterException
*/
@Override
public void addDataToStore(CarbonRow row) throws CarbonDataWriterException {
int totalComplexColumnDepth = setFlatCarbonRowForComplex(row);
if (noDictColumnPageSize == null) {
Expand Down Expand Up @@ -410,6 +412,7 @@ private TablePage processDataRows(List<CarbonRow> dataRows)
*
* @throws CarbonDataWriterException
*/
@Override
public void finish() throws CarbonDataWriterException {
// still some data is present in stores if entryCount is more
// than 0
Expand Down Expand Up @@ -480,6 +483,7 @@ private void processWriteTaskSubmitList(List<Future<Void>> taskList)
/**
* below method will be used to close the handler
*/
@Override
public void closeHandler() throws CarbonDataWriterException {
if (null != this.dataWriter) {
// wait until all blocklets have been finished writing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ private void handleEmptyDataFile(String filePath) throws IOException {
*
* @throws CarbonDataWriterException
*/
@Override
public void initializeWriter() throws CarbonDataWriterException {
this.carbonDataFileName = CarbonTablePath
.getCarbonDataFileName(fileCount, model.getCarbonDataFileAttributes().getTaskId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ protected void fillBlockIndexInfoDetails(long numberOfRows, String carbonDataFil
*
* @throws CarbonDataWriterException
*/
@Override
public void closeWriter() throws CarbonDataWriterException {
CarbonDataWriterException exception = null;
try {
Expand Down

0 comments on commit 8264b3b

Please sign in to comment.