DataOutputStream dosKey = prepareAppendKey(klen); try { ++errorCount;
public void writeApplicationACLs(Map<ApplicationAccessType, String> appAcls) throws IOException { DataOutputStream out = this.writer.prepareAppendKey(-1); APPLICATION_ACL_KEY.write(out); out.close(); out = this.writer.prepareAppendValue(-1); for (Entry<ApplicationAccessType, String> entry : appAcls.entrySet()) { out.writeUTF(entry.getKey().toString()); out.writeUTF(entry.getValue()); } out.close(); }
public void writeApplicationACLs(Map<ApplicationAccessType, String> appAcls) throws IOException { try (DataOutputStream out = this.writer.prepareAppendKey(-1)) { APPLICATION_ACL_KEY.write(out); } try (DataOutputStream out = this.writer.prepareAppendValue(-1)) { for (Entry<ApplicationAccessType, String> entry : appAcls.entrySet()) { out.writeUTF(entry.getKey().toString()); out.writeUTF(entry.getValue()); } } }
public void testFailureKeyTooLong() throws IOException { if (skip) return; DataOutputStream outKey = writer.prepareAppendKey(2); try { outKey.write("key0".getBytes()); outKey.close(); Assert.fail("Key is longer than requested."); } catch (Exception e) { // noop, expecting an exception } finally { } }
public void testFailureAddKeyWithoutValue() throws IOException { if (skip) return; DataOutputStream dos = writer.prepareAppendKey(-1); dos.write("key0".getBytes()); try { closeOutput(); fail("Cannot add only a key without a value. "); } catch (IllegalStateException e) { // noop, expecting an exception } }
public void append(LogKey logKey, LogValue logValue) throws IOException { Set<File> pendingUploadFiles = logValue.getPendingLogFilesToUploadForThisContainer(); if (pendingUploadFiles.size() == 0) { return; } try (DataOutputStream out = this.writer.prepareAppendKey(-1)) { logKey.write(out); } try (DataOutputStream out = this.writer.prepareAppendValue(-1)) { logValue.write(out, pendingUploadFiles); } }
public void append(LogKey logKey, LogValue logValue) throws IOException { Set<File> pendingUploadFiles = logValue.getPendingLogFilesToUploadForThisContainer(); if (pendingUploadFiles.size() == 0) { return; } DataOutputStream out = this.writer.prepareAppendKey(-1); logKey.write(out); out.close(); out = this.writer.prepareAppendValue(-1); logValue.write(out, pendingUploadFiles); out.close(); }
public void testFailureAddKeyWithoutValue() throws IOException { if (skip) return; DataOutputStream dos = writer.prepareAppendKey(-1); dos.write("key0".getBytes()); try { closeOutput(); fail("Cannot add only a key without a value. "); } catch (IllegalStateException e) { // noop, expecting an exception } }
public void append(LogKey logKey, LogValue logValue) throws IOException { Set<File> pendingUploadFiles = logValue.getPendingLogFilesToUploadForThisContainer(); if (pendingUploadFiles.size() == 0) { return; } try (DataOutputStream out = this.writer.prepareAppendKey(-1)) { logKey.write(out); } try (DataOutputStream out = this.writer.prepareAppendValue(-1)) { logValue.write(out, pendingUploadFiles); } }
public void testFailureAddKeyWithoutValue() throws IOException { if (skip) return; DataOutputStream dos = writer.prepareAppendKey(-1); dos.write("key0".getBytes()); try { closeOutput(); fail("Cannot add only a key without a value. "); } catch (IllegalStateException e) { // noop, expecting an exception } }
private void writeVersion() throws IOException { DataOutputStream out = this.writer.prepareAppendKey(-1); VERSION_KEY.write(out); out.close(); out = this.writer.prepareAppendValue(-1); out.writeInt(VERSION); out.close(); }
public void writeApplicationOwner(String user) throws IOException { try (DataOutputStream out = this.writer.prepareAppendKey(-1)) { APPLICATION_OWNER_KEY.write(out); } try (DataOutputStream out = this.writer.prepareAppendValue(-1)) { out.writeUTF(user); } }
private void writeVersion() throws IOException { try (DataOutputStream out = this.writer.prepareAppendKey(-1)) { VERSION_KEY.write(out); } try (DataOutputStream out = this.writer.prepareAppendValue(-1)) { out.writeInt(VERSION); } }
public void writeApplicationACLs(Map<ApplicationAccessType, String> appAcls) throws IOException { try (DataOutputStream out = this.writer.prepareAppendKey(-1)) { APPLICATION_ACL_KEY.write(out); } try (DataOutputStream out = this.writer.prepareAppendValue(-1)) { for (Entry<ApplicationAccessType, String> entry : appAcls.entrySet()) { out.writeUTF(entry.getKey().toString()); out.writeUTF(entry.getValue()); } } }
public void writeApplicationOwner(String user) throws IOException { DataOutputStream out = this.writer.prepareAppendKey(-1); APPLICATION_OWNER_KEY.write(out); out.close(); out = this.writer.prepareAppendValue(-1); out.writeUTF(user); out.close(); }
public void testFailureKeyLongerThan64K() throws IOException { if (skip) return; try { DataOutputStream outKey = writer.prepareAppendKey(64 * K + 1); Assert.fail("Failed to handle key longer than 64K."); } catch (IndexOutOfBoundsException e) { // noop, expecting exceptions } closeOutput(); }
public void testFailureKeyLongerThan64K() throws IOException { if (skip) return; try { DataOutputStream outKey = writer.prepareAppendKey(64 * K + 1); Assert.fail("Failed to handle key longer than 64K."); } catch (IndexOutOfBoundsException e) { // noop, expecting exceptions } closeOutput(); }
public void testFailureKeyLongerThan64K() throws IOException { if (skip) return; try { DataOutputStream outKey = writer.prepareAppendKey(64 * K + 1); Assert.fail("Failed to handle key longer than 64K."); } catch (IndexOutOfBoundsException e) { // noop, expecting exceptions } closeOutput(); }
private void writeVersion() throws IOException { try (DataOutputStream out = this.writer.prepareAppendKey(-1)) { VERSION_KEY.write(out); } try (DataOutputStream out = this.writer.prepareAppendValue(-1)) { out.writeInt(VERSION); } }
public void writeApplicationOwner(String user) throws IOException { try (DataOutputStream out = this.writer.prepareAppendKey(-1)) { APPLICATION_OWNER_KEY.write(out); } try (DataOutputStream out = this.writer.prepareAppendValue(-1)) { out.writeUTF(user); } }