spillFileReader.close();
public void clear() { this.buffer = initialBuffer; this.serializationReadBuffer.releaseArrays(); this.recordLength = -1; this.lengthBuffer.clear(); this.leftOverData = null; this.accumulatedRecordBytes = 0; if (spillingChannel != null) { try { spillingChannel.close(); } catch (Throwable t) { // ignore } spillingChannel = null; } if (spillFileReader != null) { try { spillFileReader.close(); } catch (Throwable t) { // ignore } spillFileReader = null; } if (spillFile != null) { spillFile.delete(); spillFile = null; } }
public void clear() { this.buffer = initialBuffer; this.serializationReadBuffer.releaseArrays(); this.recordLength = -1; this.lengthBuffer.clear(); this.leftOverData = null; this.accumulatedRecordBytes = 0; if (spillingChannel != null) { try { spillingChannel.close(); } catch (Throwable t) { // ignore } spillingChannel = null; } if (spillFileReader != null) { try { spillFileReader.close(); } catch (Throwable t) { // ignore } spillFileReader = null; } if (spillFile != null) { spillFile.delete(); spillFile = null; } }
public void clear() { this.buffer = initialBuffer; this.serializationReadBuffer.releaseArrays(); this.recordLength = -1; this.lengthBuffer.clear(); this.leftOverData = null; this.accumulatedRecordBytes = 0; if (spillingChannel != null) { try { spillingChannel.close(); } catch (Throwable t) { // ignore } spillingChannel = null; } if (spillFileReader != null) { try { spillFileReader.close(); } catch (Throwable t) { // ignore } spillFileReader = null; } if (spillFile != null) { spillFile.delete(); spillFile = null; } }
private void restoreState() throws Exception { LOGGER.info("Restore siddhi state"); final Iterator<byte[]> siddhiState = siddhiRuntimeState.get().iterator(); if (siddhiState.hasNext()) { // TODO this.siddhiRuntime.restore(siddhiState.next()); } LOGGER.info("Restore queued records state"); final Iterator<byte[]> queueState = queuedRecordsState.get().iterator(); if (queueState.hasNext()) { final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(queueState.next()); final DataInputViewStreamWrapper dataInputView = new DataInputViewStreamWrapper(byteArrayInputStream); try { this.priorityQueue = restoreQueueState(dataInputView); } finally { dataInputView.close(); byteArrayInputStream.close(); } } }
private void restoreState() throws Exception { LOGGER.info("Restore siddhi state"); final Iterator<byte[]> siddhiState = siddhiRuntimeState.get().iterator(); if (siddhiState.hasNext()) { this.siddhiRuntime.restore(siddhiState.next()); } LOGGER.info("Restore queued records state"); final Iterator<byte[]> queueState = queuedRecordsState.get().iterator(); if (queueState.hasNext()) { final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(queueState.next()); final DataInputViewStreamWrapper dataInputView = new DataInputViewStreamWrapper(byteArrayInputStream); try { this.priorityQueue = restoreQueuerState(dataInputView); } finally { dataInputView.close(); byteArrayInputStream.close(); } } }
byte[] writtenBytesOfCopy = outputStreamForCopy.toByteArray(); outputView.close(); inputView.close();