@Override public Boolean answer(InvocationOnMock invocationOnMock) throws Throwable { long logId = ((Long) invocationOnMock.getArgument(0)).longValue(); switch ((int) logId) { case 2: // Create a file so that real rollWriter() runs into file exists condition Path logFilePath = mStore.getLogFilePath(logId); mStore.getFileSystem().create(logFilePath); break; case 3: // Success only when we retry with logId 3 tested[0] = true; default: break; } return (Boolean) invocationOnMock.callRealMethod(); } };
Path newLogFile = null; long startPos = -1; newLogFile = getLogFilePath(logId); try { newStream = CommonFSUtils.createForWal(fs, newLogFile, false);
@Override public Boolean answer(InvocationOnMock invocationOnMock) throws Throwable { long logId = ((Long) invocationOnMock.getArgument(0)).longValue(); switch ((int) logId) { case 2: // Create a file so that real rollWriter() runs into file exists condition Path logFilePath = mStore.getLogFilePath(logId); mStore.getFileSystem().create(logFilePath); break; case 3: // Success only when we retry with logId 3 tested[0] = true; default: break; } return (Boolean) invocationOnMock.callRealMethod(); } };
Path newLogFile = null; long startPos = -1; newLogFile = getLogFilePath(logId); try { newStream = fs.create(newLogFile, false);
@Override public Boolean answer(InvocationOnMock invocationOnMock) throws Throwable { long logId = ((Long) invocationOnMock.getArgument(0)).longValue(); switch ((int) logId) { case 2: // Create a file so that real rollWriter() runs into file exists condition Path logFilePath = mStore.getLogFilePath(logId); mStore.getFileSystem().create(logFilePath); break; case 3: // Success only when we retry with logId 3 tested[0] = true; default: break; } return (Boolean) invocationOnMock.callRealMethod(); } };
Path newLogFile = null; long startPos = -1; newLogFile = getLogFilePath(logId); try { newStream = CommonFSUtils.createForWal(fs, newLogFile, false);
Path newLogFile = null; long startPos = -1; newLogFile = getLogFilePath(logId); try { newStream = fs.create(newLogFile, false);