|
@@ -176,11 +176,15 @@ public class ReduceContextImpl<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
|
|
return value;
|
|
return value;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ BackupStore<KEYIN,VALUEIN> getBackupStore() {
|
|
|
|
+ return backupStore;
|
|
|
|
+ }
|
|
|
|
+
|
|
protected class ValueIterator implements ReduceContext.ValueIterator<VALUEIN> {
|
|
protected class ValueIterator implements ReduceContext.ValueIterator<VALUEIN> {
|
|
|
|
|
|
private boolean inReset = false;
|
|
private boolean inReset = false;
|
|
private boolean clearMarkFlag = false;
|
|
private boolean clearMarkFlag = false;
|
|
-
|
|
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public boolean hasNext() {
|
|
public boolean hasNext() {
|
|
try {
|
|
try {
|
|
@@ -247,7 +251,7 @@ public class ReduceContextImpl<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void mark() throws IOException {
|
|
public void mark() throws IOException {
|
|
- if (backupStore == null) {
|
|
|
|
|
|
+ if (getBackupStore() == null) {
|
|
backupStore = new BackupStore<KEYIN,VALUEIN>(conf, taskid);
|
|
backupStore = new BackupStore<KEYIN,VALUEIN>(conf, taskid);
|
|
}
|
|
}
|
|
isMarked = true;
|
|
isMarked = true;
|
|
@@ -290,7 +294,7 @@ public class ReduceContextImpl<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void clearMark() throws IOException {
|
|
public void clearMark() throws IOException {
|
|
- if (backupStore == null) {
|
|
|
|
|
|
+ if (getBackupStore() == null) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
if (inReset) {
|
|
if (inReset) {
|
|
@@ -308,7 +312,7 @@ public class ReduceContextImpl<KEYIN,VALUEIN,KEYOUT,VALUEOUT>
|
|
* @throws IOException
|
|
* @throws IOException
|
|
*/
|
|
*/
|
|
public void resetBackupStore() throws IOException {
|
|
public void resetBackupStore() throws IOException {
|
|
- if (backupStore == null) {
|
|
|
|
|
|
+ if (getBackupStore() == null) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
inReset = isMarked = false;
|
|
inReset = isMarked = false;
|