/** * Obtain an output stream for writing a key into TFile. This may only be * called when there is no active Key appending stream or value appending * stream. * * @param length * The expected length of the key. If length of the key is not * known, set length = -1. Otherwise, the application must write * exactly as many bytes as specified here before calling close on * the returned output stream. * @return The key appending output stream. * @throws IOException * */ public DataOutputStream prepareAppendKey(int length) throws IOException { if (state != State.READY) { throw new IllegalStateException("Incorrect state to start a new key: " + state.name()); } initDataBlock(); DataOutputStream ret = new KeyRegister(length); state = State.IN_KEY; return ret; }
/** * Obtain an output stream for writing a key into TFile. This may only be * called when there is no active Key appending stream or value appending * stream. * * @param length * The expected length of the key. If length of the key is not * known, set length = -1. Otherwise, the application must write * exactly as many bytes as specified here before calling close on * the returned output stream. * @return The key appending output stream. * @throws IOException * */ public DataOutputStream prepareAppendKey(int length) throws IOException { if (state != State.READY) { throw new IllegalStateException("Incorrect state to start a new key: " + state.name()); } initDataBlock(); DataOutputStream ret = new KeyRegister(length); state = State.IN_KEY; return ret; }
/** * Obtain an output stream for writing a key into TFile. This may only be * called when there is no active Key appending stream or value appending * stream. * * @param length * The expected length of the key. If length of the key is not * known, set length = -1. Otherwise, the application must write * exactly as many bytes as specified here before calling close on * the returned output stream. * @return The key appending output stream. * @throws IOException * */ public DataOutputStream prepareAppendKey(int length) throws IOException { if (state != State.READY) { throw new IllegalStateException("Incorrect state to start a new key: " + state.name()); } initDataBlock(); DataOutputStream ret = new KeyRegister(length); state = State.IN_KEY; return ret; }
/** * Obtain an output stream for writing a key into TFile. This may only be * called when there is no active Key appending stream or value appending * stream. * * @param length * The expected length of the key. If length of the key is not * known, set length = -1. Otherwise, the application must write * exactly as many bytes as specified here before calling close on * the returned output stream. * @return The key appending output stream. * @throws IOException * */ public DataOutputStream prepareAppendKey(int length) throws IOException { if (state != State.READY) { throw new IllegalStateException("Incorrect state to start a new key: " + state.name()); } initDataBlock(); DataOutputStream ret = new KeyRegister(length); state = State.IN_KEY; return ret; }
/** * Obtain an output stream for writing a key into TFile. This may only be * called when there is no active Key appending stream or value appending * stream. * * @param length * The expected length of the key. If length of the key is not * known, set length = -1. Otherwise, the application must write * exactly as many bytes as specified here before calling close on * the returned output stream. * @return The key appending output stream. * @throws IOException * */ public DataOutputStream prepareAppendKey(int length) throws IOException { if (state != State.READY) { throw new IllegalStateException("Incorrect state to start a new key: " + state.name()); } initDataBlock(); DataOutputStream ret = new KeyRegister(length); state = State.IN_KEY; return ret; }
/** * Obtain an output stream for writing a key into TFile. This may only be * called when there is no active Key appending stream or value appending * stream. * * @param length * The expected length of the key. If length of the key is not * known, set length = -1. Otherwise, the application must write * exactly as many bytes as specified here before calling close on * the returned output stream. * @return The key appending output stream. * @throws IOException * */ public DataOutputStream prepareAppendKey(int length) throws IOException { if (state != State.READY) { throw new IllegalStateException("Incorrect state to start a new key: " + state.name()); } initDataBlock(); DataOutputStream ret = new KeyRegister(length); state = State.IN_KEY; return ret; }