target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testStandbyDirsAlreadyExist() throws Exception { int rc = BootstrapStandby.run( new String[]{"-nonInteractive"}, cluster.getConfiguration(1)); assertEquals(BootstrapStandby.ERR_CODE_ALREADY_FORMATTED, rc); rc = BootstrapStandby.run( new String[]{"-force"}, cluster.getConfiguration(1)); assertEquals(0,...
@Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY, myAddr.getHostName()); return SecurityUtil.doAs...
BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY...
BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY...
BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY...
BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY...
@Test public void testKeyOnlyFilter() throws IOException { String filterString = "KeyOnlyFilter()"; doTestFilter(filterString, KeyOnlyFilter.class); String filterString2 = "KeyOnlyFilter ('') "; byte [] filterStringAsByteArray2 = Bytes.toBytes(filterString2); try { filter = f.parseFilterString(filterStringAsByteArray2)...
public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); }
ParseFilter { public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); } }
ParseFilter { public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); } }
ParseFilter { public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); } Filter parseFilterString(String filterString); Filter parseFilterString(byte [] filterStringAsByteArray); byte [] extractFilterSimpleExpression(byte [] filterSt...
ParseFilter { public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); } Filter parseFilterString(String filterString); Filter parseFilterString(byte [] filterStringAsByteArray); byte [] extractFilterSimpleExpression(byte [] filterSt...
@Test(timeout=30000) public void testOtherNodeNotActive() throws Exception { cluster.transitionToStandby(0); int rc = BootstrapStandby.run( new String[]{"-force"}, cluster.getConfiguration(1)); assertEquals(0, rc); }
@Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY, myAddr.getHostName()); return SecurityUtil.doAs...
BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY...
BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY...
BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY...
BootstrapStandby implements Tool, Configurable { @Override public int run(String[] args) throws Exception { parseArgs(args); parseConfAndFindOtherNN(); NameNode.checkAllowFormat(conf); InetSocketAddress myAddr = NameNode.getAddress(conf); SecurityUtil.login(conf, DFS_NAMENODE_KEYTAB_FILE_KEY, DFS_NAMENODE_USER_NAME_KEY...
@Test public void testIsValidRequestor() throws IOException { Configuration conf = new HdfsConfiguration(); KerberosName.setRules("RULE:[1:$1]\nRULE:[2:$1]"); conf.set(DFSConfigKeys.DFS_NAMESERVICES, "ns1"); conf.set(DFSUtil.addKeySuffixes(DFSConfigKeys.DFS_HA_NAMENODES_KEY_PREFIX, "ns1"), "nn1,nn2"); conf.set(DFSUtil....
@VisibleForTesting static boolean isValidRequestor(ServletContext context, String remoteUser, Configuration conf) throws IOException { if(remoteUser == null) { LOG.warn("Received null remoteUser while authorizing access to getImage servlet"); return false; } Set<String> validRequestors = new HashSet<String>(); validReq...
GetImageServlet extends HttpServlet { @VisibleForTesting static boolean isValidRequestor(ServletContext context, String remoteUser, Configuration conf) throws IOException { if(remoteUser == null) { LOG.warn("Received null remoteUser while authorizing access to getImage servlet"); return false; } Set<String> validReques...
GetImageServlet extends HttpServlet { @VisibleForTesting static boolean isValidRequestor(ServletContext context, String remoteUser, Configuration conf) throws IOException { if(remoteUser == null) { LOG.warn("Received null remoteUser while authorizing access to getImage servlet"); return false; } Set<String> validReques...
GetImageServlet extends HttpServlet { @VisibleForTesting static boolean isValidRequestor(ServletContext context, String remoteUser, Configuration conf) throws IOException { if(remoteUser == null) { LOG.warn("Received null remoteUser while authorizing access to getImage servlet"); return false; } Set<String> validReques...
GetImageServlet extends HttpServlet { @VisibleForTesting static boolean isValidRequestor(ServletContext context, String remoteUser, Configuration conf) throws IOException { if(remoteUser == null) { LOG.warn("Received null remoteUser while authorizing access to getImage servlet"); return false; } Set<String> validReques...
@Test public void testDelegationToken() throws IOException, InterruptedException { NamenodeProtocols nn = cluster.getNameNodeRpc(); HttpServletRequest request = mock(HttpServletRequest.class); UserGroupInformation ugi = UserGroupInformation.createRemoteUser("auser"); String tokenString = NamenodeJspHelper.getDelegation...
static String getDelegationToken(final NamenodeProtocols nn, HttpServletRequest request, Configuration conf, final UserGroupInformation ugi) throws IOException, InterruptedException { Token<DelegationTokenIdentifier> token = ugi .doAs(new PrivilegedExceptionAction<Token<DelegationTokenIdentifier>>() { @Override public ...
NamenodeJspHelper { static String getDelegationToken(final NamenodeProtocols nn, HttpServletRequest request, Configuration conf, final UserGroupInformation ugi) throws IOException, InterruptedException { Token<DelegationTokenIdentifier> token = ugi .doAs(new PrivilegedExceptionAction<Token<DelegationTokenIdentifier>>()...
NamenodeJspHelper { static String getDelegationToken(final NamenodeProtocols nn, HttpServletRequest request, Configuration conf, final UserGroupInformation ugi) throws IOException, InterruptedException { Token<DelegationTokenIdentifier> token = ugi .doAs(new PrivilegedExceptionAction<Token<DelegationTokenIdentifier>>()...
NamenodeJspHelper { static String getDelegationToken(final NamenodeProtocols nn, HttpServletRequest request, Configuration conf, final UserGroupInformation ugi) throws IOException, InterruptedException { Token<DelegationTokenIdentifier> token = ugi .doAs(new PrivilegedExceptionAction<Token<DelegationTokenIdentifier>>()...
NamenodeJspHelper { static String getDelegationToken(final NamenodeProtocols nn, HttpServletRequest request, Configuration conf, final UserGroupInformation ugi) throws IOException, InterruptedException { Token<DelegationTokenIdentifier> token = ugi .doAs(new PrivilegedExceptionAction<Token<DelegationTokenIdentifier>>()...
@Test public void tesSecurityModeText() { conf.set(DFSConfigKeys.HADOOP_SECURITY_AUTHENTICATION, "kerberos"); UserGroupInformation.setConfiguration(conf); String securityOnOff = NamenodeJspHelper.getSecurityModeText(); Assert.assertTrue("security mode doesn't match. Should be ON", securityOnOff.contains("ON")); conf.se...
static String getSecurityModeText() { if(UserGroupInformation.isSecurityEnabled()) { return "<div class=\"security\">Security is <em>ON</em></div>"; } else { return "<div class=\"security\">Security is <em>OFF</em></div>"; } }
NamenodeJspHelper { static String getSecurityModeText() { if(UserGroupInformation.isSecurityEnabled()) { return "<div class=\"security\">Security is <em>ON</em></div>"; } else { return "<div class=\"security\">Security is <em>OFF</em></div>"; } } }
NamenodeJspHelper { static String getSecurityModeText() { if(UserGroupInformation.isSecurityEnabled()) { return "<div class=\"security\">Security is <em>ON</em></div>"; } else { return "<div class=\"security\">Security is <em>OFF</em></div>"; } } }
NamenodeJspHelper { static String getSecurityModeText() { if(UserGroupInformation.isSecurityEnabled()) { return "<div class=\"security\">Security is <em>ON</em></div>"; } else { return "<div class=\"security\">Security is <em>OFF</em></div>"; } } }
NamenodeJspHelper { static String getSecurityModeText() { if(UserGroupInformation.isSecurityEnabled()) { return "<div class=\"security\">Security is <em>ON</em></div>"; } else { return "<div class=\"security\">Security is <em>OFF</em></div>"; } } }
@Test public void testReplication () { replication = 3; preferredBlockSize = 128*1024*1024; INodeFile inf = new INodeFile(new PermissionStatus(userName, null, FsPermission.getDefault()), null, replication, 0L, 0L, preferredBlockSize); assertEquals("True has to be returned in this case", replication, inf.getBlockReplica...
@Override public short getBlockReplication() { return (short) ((header & HEADERMASK) >> BLOCKBITS); }
INodeFile extends INode implements BlockCollection { @Override public short getBlockReplication() { return (short) ((header & HEADERMASK) >> BLOCKBITS); } }
INodeFile extends INode implements BlockCollection { @Override public short getBlockReplication() { return (short) ((header & HEADERMASK) >> BLOCKBITS); } INodeFile(PermissionStatus permissions, BlockInfo[] blklist, short replication, long modificationTime, long atime, long p...
INodeFile extends INode implements BlockCollection { @Override public short getBlockReplication() { return (short) ((header & HEADERMASK) >> BLOCKBITS); } INodeFile(PermissionStatus permissions, BlockInfo[] blklist, short replication, long modificationTime, long atime, long p...
INodeFile extends INode implements BlockCollection { @Override public short getBlockReplication() { return (short) ((header & HEADERMASK) >> BLOCKBITS); } INodeFile(PermissionStatus permissions, BlockInfo[] blklist, short replication, long modificationTime, long atime, long p...
@Test public void testPreferredBlockSize () { replication = 3; preferredBlockSize = 128*1024*1024; INodeFile inf = new INodeFile(new PermissionStatus(userName, null, FsPermission.getDefault()), null, replication, 0L, 0L, preferredBlockSize); assertEquals("True has to be returned in this case", preferredBlockSize, inf.g...
@Override public long getPreferredBlockSize() { return header & ~HEADERMASK; }
INodeFile extends INode implements BlockCollection { @Override public long getPreferredBlockSize() { return header & ~HEADERMASK; } }
INodeFile extends INode implements BlockCollection { @Override public long getPreferredBlockSize() { return header & ~HEADERMASK; } INodeFile(PermissionStatus permissions, BlockInfo[] blklist, short replication, long modificationTime, long atime, long preferredBlockSize); }
INodeFile extends INode implements BlockCollection { @Override public long getPreferredBlockSize() { return header & ~HEADERMASK; } INodeFile(PermissionStatus permissions, BlockInfo[] blklist, short replication, long modificationTime, long atime, long preferredBlockSize); sta...
INodeFile extends INode implements BlockCollection { @Override public long getPreferredBlockSize() { return header & ~HEADERMASK; } INodeFile(PermissionStatus permissions, BlockInfo[] blklist, short replication, long modificationTime, long atime, long preferredBlockSize); sta...
@Test public void testPreferredBlockSizeUpperBound () { replication = 3; preferredBlockSize = BLKSIZE_MAXVALUE; INodeFile inf = new INodeFile(new PermissionStatus(userName, null, FsPermission.getDefault()), null, replication, 0L, 0L, preferredBlockSize); assertEquals("True has to be returned in this case", BLKSIZE_MAXV...
@Override public long getPreferredBlockSize() { return header & ~HEADERMASK; }
INodeFile extends INode implements BlockCollection { @Override public long getPreferredBlockSize() { return header & ~HEADERMASK; } }
INodeFile extends INode implements BlockCollection { @Override public long getPreferredBlockSize() { return header & ~HEADERMASK; } INodeFile(PermissionStatus permissions, BlockInfo[] blklist, short replication, long modificationTime, long atime, long preferredBlockSize); }
INodeFile extends INode implements BlockCollection { @Override public long getPreferredBlockSize() { return header & ~HEADERMASK; } INodeFile(PermissionStatus permissions, BlockInfo[] blklist, short replication, long modificationTime, long atime, long preferredBlockSize); sta...
INodeFile extends INode implements BlockCollection { @Override public long getPreferredBlockSize() { return header & ~HEADERMASK; } INodeFile(PermissionStatus permissions, BlockInfo[] blklist, short replication, long modificationTime, long atime, long preferredBlockSize); sta...
@Test public void testAppendBlocks() { INodeFile origFile = createINodeFiles(1, "origfile")[0]; assertEquals("Number of blocks didn't match", origFile.numBlocks(), 1L); INodeFile[] appendFiles = createINodeFiles(4, "appendfile"); origFile.appendBlocks(appendFiles, getTotalBlocks(appendFiles)); assertEquals("Number of b...
void appendBlocks(INodeFile [] inodes, int totalAddedBlocks) { int size = this.blocks.length; BlockInfo[] newlist = new BlockInfo[size + totalAddedBlocks]; System.arraycopy(this.blocks, 0, newlist, 0, size); for(INodeFile in: inodes) { System.arraycopy(in.blocks, 0, newlist, size, in.blocks.length); size += in.blocks.l...
INodeFile extends INode implements BlockCollection { void appendBlocks(INodeFile [] inodes, int totalAddedBlocks) { int size = this.blocks.length; BlockInfo[] newlist = new BlockInfo[size + totalAddedBlocks]; System.arraycopy(this.blocks, 0, newlist, 0, size); for(INodeFile in: inodes) { System.arraycopy(in.blocks, 0, ...
INodeFile extends INode implements BlockCollection { void appendBlocks(INodeFile [] inodes, int totalAddedBlocks) { int size = this.blocks.length; BlockInfo[] newlist = new BlockInfo[size + totalAddedBlocks]; System.arraycopy(this.blocks, 0, newlist, 0, size); for(INodeFile in: inodes) { System.arraycopy(in.blocks, 0, ...
INodeFile extends INode implements BlockCollection { void appendBlocks(INodeFile [] inodes, int totalAddedBlocks) { int size = this.blocks.length; BlockInfo[] newlist = new BlockInfo[size + totalAddedBlocks]; System.arraycopy(this.blocks, 0, newlist, 0, size); for(INodeFile in: inodes) { System.arraycopy(in.blocks, 0, ...
INodeFile extends INode implements BlockCollection { void appendBlocks(INodeFile [] inodes, int totalAddedBlocks) { int size = this.blocks.length; BlockInfo[] newlist = new BlockInfo[size + totalAddedBlocks]; System.arraycopy(this.blocks, 0, newlist, 0, size); for(INodeFile in: inodes) { System.arraycopy(in.blocks, 0, ...
@Test public void testValueOf () throws IOException { final String path = "/testValueOf"; final PermissionStatus perm = new PermissionStatus( userName, null, FsPermission.getDefault()); final short replication = 3; { final INode from = null; try { INodeFile.valueOf(from, path); fail(); } catch(FileNotFoundException fnf...
public static INodeFile valueOf(INode inode, String path) throws IOException { if (inode == null) { throw new FileNotFoundException("File does not exist: " + path); } if (!(inode instanceof INodeFile)) { throw new FileNotFoundException("Path is not a file: " + path); } return (INodeFile)inode; }
INodeFile extends INode implements BlockCollection { public static INodeFile valueOf(INode inode, String path) throws IOException { if (inode == null) { throw new FileNotFoundException("File does not exist: " + path); } if (!(inode instanceof INodeFile)) { throw new FileNotFoundException("Path is not a file: " + path);...
INodeFile extends INode implements BlockCollection { public static INodeFile valueOf(INode inode, String path) throws IOException { if (inode == null) { throw new FileNotFoundException("File does not exist: " + path); } if (!(inode instanceof INodeFile)) { throw new FileNotFoundException("Path is not a file: " + path);...
INodeFile extends INode implements BlockCollection { public static INodeFile valueOf(INode inode, String path) throws IOException { if (inode == null) { throw new FileNotFoundException("File does not exist: " + path); } if (!(inode instanceof INodeFile)) { throw new FileNotFoundException("Path is not a file: " + path);...
INodeFile extends INode implements BlockCollection { public static INodeFile valueOf(INode inode, String path) throws IOException { if (inode == null) { throw new FileNotFoundException("File does not exist: " + path); } if (!(inode instanceof INodeFile)) { throw new FileNotFoundException("Path is not a file: " + path);...
@Test public void testFirstKeyOnlyFilter() throws IOException { String filterString = " FirstKeyOnlyFilter( ) "; doTestFilter(filterString, FirstKeyOnlyFilter.class); String filterString2 = " FirstKeyOnlyFilter ('') "; byte [] filterStringAsByteArray2 = Bytes.toBytes(filterString2); try { filter = f.parseFilterString(f...
public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); }
ParseFilter { public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); } }
ParseFilter { public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); } }
ParseFilter { public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); } Filter parseFilterString(String filterString); Filter parseFilterString(byte [] filterStringAsByteArray); byte [] extractFilterSimpleExpression(byte [] filterSt...
ParseFilter { public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); } Filter parseFilterString(String filterString); Filter parseFilterString(byte [] filterStringAsByteArray); byte [] extractFilterSimpleExpression(byte [] filterSt...
@Test public void testEditLogFileOutputStreamCloseClose() throws IOException { EditLogFileOutputStream editLogStream = new EditLogFileOutputStream(TEST_EDITS, 0); editLogStream.close(); try { editLogStream.close(); } catch (IOException ioe) { String msg = StringUtils.stringifyException(ioe); assertTrue(msg, msg.contain...
@Override public void close() throws IOException { if (fp == null) { throw new IOException("Trying to use aborted output stream"); } try { if (doubleBuf != null) { doubleBuf.close(); doubleBuf = null; } if (fc != null && fc.isOpen()) { fc.truncate(fc.position()); fc.close(); fc = null; } if (fp != null) { fp.close(); f...
EditLogFileOutputStream extends EditLogOutputStream { @Override public void close() throws IOException { if (fp == null) { throw new IOException("Trying to use aborted output stream"); } try { if (doubleBuf != null) { doubleBuf.close(); doubleBuf = null; } if (fc != null && fc.isOpen()) { fc.truncate(fc.position()); fc...
EditLogFileOutputStream extends EditLogOutputStream { @Override public void close() throws IOException { if (fp == null) { throw new IOException("Trying to use aborted output stream"); } try { if (doubleBuf != null) { doubleBuf.close(); doubleBuf = null; } if (fc != null && fc.isOpen()) { fc.truncate(fc.position()); fc...
EditLogFileOutputStream extends EditLogOutputStream { @Override public void close() throws IOException { if (fp == null) { throw new IOException("Trying to use aborted output stream"); } try { if (doubleBuf != null) { doubleBuf.close(); doubleBuf = null; } if (fc != null && fc.isOpen()) { fc.truncate(fc.position()); fc...
EditLogFileOutputStream extends EditLogOutputStream { @Override public void close() throws IOException { if (fp == null) { throw new IOException("Trying to use aborted output stream"); } try { if (doubleBuf != null) { doubleBuf.close(); doubleBuf = null; } if (fc != null && fc.isOpen()) { fc.truncate(fc.position()); fc...
@Test public void testEditLogFileOutputStreamAbortAbort() throws IOException { EditLogFileOutputStream editLogStream = new EditLogFileOutputStream(TEST_EDITS, 0); editLogStream.abort(); editLogStream.abort(); }
@Override public void abort() throws IOException { if (fp == null) { return; } IOUtils.cleanup(LOG, fp); fp = null; }
EditLogFileOutputStream extends EditLogOutputStream { @Override public void abort() throws IOException { if (fp == null) { return; } IOUtils.cleanup(LOG, fp); fp = null; } }
EditLogFileOutputStream extends EditLogOutputStream { @Override public void abort() throws IOException { if (fp == null) { return; } IOUtils.cleanup(LOG, fp); fp = null; } EditLogFileOutputStream(File name, int size); }
EditLogFileOutputStream extends EditLogOutputStream { @Override public void abort() throws IOException { if (fp == null) { return; } IOUtils.cleanup(LOG, fp); fp = null; } EditLogFileOutputStream(File name, int size); @Override void write(FSEditLogOp op); @Override void writeRaw(byte[] bytes, int offset, int length); @...
EditLogFileOutputStream extends EditLogOutputStream { @Override public void abort() throws IOException { if (fp == null) { return; } IOUtils.cleanup(LOG, fp); fp = null; } EditLogFileOutputStream(File name, int size); @Override void write(FSEditLogOp op); @Override void writeRaw(byte[] bytes, int offset, int length); @...
@Test public void testValidateEmptyEditLog() throws IOException { File testDir = new File(TEST_DIR, "testValidateEmptyEditLog"); SortedMap<Long, Long> offsetToTxId = Maps.newTreeMap(); File logFile = prepareUnfinalizedTestEditLog(testDir, 0, offsetToTxId); truncateFile(logFile, 4); EditLogValidation validation = EditLo...
static EditLogValidation validateEditLog(EditLogInputStream in) { long lastPos = 0; long lastTxId = HdfsConstants.INVALID_TXID; long numValid = 0; FSEditLogOp op = null; while (true) { lastPos = in.getPosition(); try { if ((op = in.readOp()) == null) { break; } } catch (Throwable t) { FSImage.LOG.warn("Caught exception...
FSEditLogLoader { static EditLogValidation validateEditLog(EditLogInputStream in) { long lastPos = 0; long lastTxId = HdfsConstants.INVALID_TXID; long numValid = 0; FSEditLogOp op = null; while (true) { lastPos = in.getPosition(); try { if ((op = in.readOp()) == null) { break; } } catch (Throwable t) { FSImage.LOG.warn...
FSEditLogLoader { static EditLogValidation validateEditLog(EditLogInputStream in) { long lastPos = 0; long lastTxId = HdfsConstants.INVALID_TXID; long numValid = 0; FSEditLogOp op = null; while (true) { lastPos = in.getPosition(); try { if ((op = in.readOp()) == null) { break; } } catch (Throwable t) { FSImage.LOG.warn...
FSEditLogLoader { static EditLogValidation validateEditLog(EditLogInputStream in) { long lastPos = 0; long lastTxId = HdfsConstants.INVALID_TXID; long numValid = 0; FSEditLogOp op = null; while (true) { lastPos = in.getPosition(); try { if ((op = in.readOp()) == null) { break; } } catch (Throwable t) { FSImage.LOG.warn...
FSEditLogLoader { static EditLogValidation validateEditLog(EditLogInputStream in) { long lastPos = 0; long lastTxId = HdfsConstants.INVALID_TXID; long numValid = 0; FSEditLogOp op = null; while (true) { lastPos = in.getPosition(); try { if ((op = in.readOp()) == null) { break; } } catch (Throwable t) { FSImage.LOG.warn...
@Test public void testUniqueEditDirs() throws IOException { Configuration config = new Configuration(); config.set(DFS_NAMENODE_EDITS_DIR_KEY, "file: + "file: Collection<URI> editsDirs = FSNamesystem.getNamespaceEditsDirs(config); assertEquals(2, editsDirs.size()); }
public static List<URI> getNamespaceEditsDirs(Configuration conf) throws IOException { return getNamespaceEditsDirs(conf, true); }
FSNamesystem implements Namesystem, FSClusterStats, FSNamesystemMBean, NameNodeMXBean { public static List<URI> getNamespaceEditsDirs(Configuration conf) throws IOException { return getNamespaceEditsDirs(conf, true); } }
FSNamesystem implements Namesystem, FSClusterStats, FSNamesystemMBean, NameNodeMXBean { public static List<URI> getNamespaceEditsDirs(Configuration conf) throws IOException { return getNamespaceEditsDirs(conf, true); } FSNamesystem(Configuration conf, FSImage fsImage); }
FSNamesystem implements Namesystem, FSClusterStats, FSNamesystemMBean, NameNodeMXBean { public static List<URI> getNamespaceEditsDirs(Configuration conf) throws IOException { return getNamespaceEditsDirs(conf, true); } FSNamesystem(Configuration conf, FSImage fsImage); static FSNamesystem loadFromDisk(Configuration...
FSNamesystem implements Namesystem, FSClusterStats, FSNamesystemMBean, NameNodeMXBean { public static List<URI> getNamespaceEditsDirs(Configuration conf) throws IOException { return getNamespaceEditsDirs(conf, true); } FSNamesystem(Configuration conf, FSImage fsImage); static FSNamesystem loadFromDisk(Configuration...
@Test public void testChecking2NameDirsOnOneVolume() throws IOException { Configuration conf = new Configuration(); File nameDir1 = new File(System.getProperty("test.build.data"), "name-dir1"); File nameDir2 = new File(System.getProperty("test.build.data"), "name-dir2"); nameDir1.mkdirs(); nameDir2.mkdirs(); conf.set(D...
@VisibleForTesting Collection<String> getVolumesLowOnSpace() throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Going to check the following volumes disk space: " + volumes); } Collection<String> lowVolumes = new ArrayList<String>(); for (CheckedVolume volume : volumes.values()) { lowVolumes.add(volume.getVolu...
NameNodeResourceChecker { @VisibleForTesting Collection<String> getVolumesLowOnSpace() throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Going to check the following volumes disk space: " + volumes); } Collection<String> lowVolumes = new ArrayList<String>(); for (CheckedVolume volume : volumes.values()) { low...
NameNodeResourceChecker { @VisibleForTesting Collection<String> getVolumesLowOnSpace() throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Going to check the following volumes disk space: " + volumes); } Collection<String> lowVolumes = new ArrayList<String>(); for (CheckedVolume volume : volumes.values()) { low...
NameNodeResourceChecker { @VisibleForTesting Collection<String> getVolumesLowOnSpace() throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Going to check the following volumes disk space: " + volumes); } Collection<String> lowVolumes = new ArrayList<String>(); for (CheckedVolume volume : volumes.values()) { low...
NameNodeResourceChecker { @VisibleForTesting Collection<String> getVolumesLowOnSpace() throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Going to check the following volumes disk space: " + volumes); } Collection<String> lowVolumes = new ArrayList<String>(); for (CheckedVolume volume : volumes.values()) { low...
@Test public void testIncorrectFilterString () throws IOException { String filterString = "()"; byte [] filterStringAsByteArray = Bytes.toBytes(filterString); try { filter = f.parseFilterString(filterStringAsByteArray); assertTrue(false); } catch (IllegalArgumentException e) { System.out.println(e.getMessage()); } }
public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); }
ParseFilter { public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); } }
ParseFilter { public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); } }
ParseFilter { public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); } Filter parseFilterString(String filterString); Filter parseFilterString(byte [] filterStringAsByteArray); byte [] extractFilterSimpleExpression(byte [] filterSt...
ParseFilter { public Filter parseFilterString (String filterString) throws CharacterCodingException { return parseFilterString(Bytes.toBytes(filterString)); } Filter parseFilterString(String filterString); Filter parseFilterString(byte [] filterStringAsByteArray); byte [] extractFilterSimpleExpression(byte [] filterSt...
@Test public void testCheckingExtraVolumes() throws IOException { Configuration conf = new Configuration(); File nameDir = new File(System.getProperty("test.build.data"), "name-dir"); nameDir.mkdirs(); conf.set(DFSConfigKeys.DFS_NAMENODE_EDITS_DIR_KEY, nameDir.getAbsolutePath()); conf.set(DFSConfigKeys.DFS_NAMENODE_CHE...
@VisibleForTesting Collection<String> getVolumesLowOnSpace() throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Going to check the following volumes disk space: " + volumes); } Collection<String> lowVolumes = new ArrayList<String>(); for (CheckedVolume volume : volumes.values()) { lowVolumes.add(volume.getVolu...
NameNodeResourceChecker { @VisibleForTesting Collection<String> getVolumesLowOnSpace() throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Going to check the following volumes disk space: " + volumes); } Collection<String> lowVolumes = new ArrayList<String>(); for (CheckedVolume volume : volumes.values()) { low...
NameNodeResourceChecker { @VisibleForTesting Collection<String> getVolumesLowOnSpace() throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Going to check the following volumes disk space: " + volumes); } Collection<String> lowVolumes = new ArrayList<String>(); for (CheckedVolume volume : volumes.values()) { low...
NameNodeResourceChecker { @VisibleForTesting Collection<String> getVolumesLowOnSpace() throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Going to check the following volumes disk space: " + volumes); } Collection<String> lowVolumes = new ArrayList<String>(); for (CheckedVolume volume : volumes.values()) { low...
NameNodeResourceChecker { @VisibleForTesting Collection<String> getVolumesLowOnSpace() throws IOException { if (LOG.isDebugEnabled()) { LOG.debug("Going to check the following volumes disk space: " + volumes); } Collection<String> lowVolumes = new ArrayList<String>(); for (CheckedVolume volume : volumes.values()) { low...
@Test public void testWriteTo() throws IOException { FSInputStream fsin = new MockFSInputStream(); ByteArrayOutputStream os = new ByteArrayOutputStream(); int[] pairs = new int[]{ 0, 10000, 50, 100, 50, 6000, 1000, 2000, 0, 1, 0, 0, 5000, 0, }; assertTrue("Pairs array must be even", pairs.length % 2 == 0); for (int i =...
static void copyFromOffset(FSInputStream in, OutputStream out, long offset, long count) throws IOException { in.seek(offset); IOUtils.copyBytes(in, out, count, false); }
StreamFile extends DfsServlet { static void copyFromOffset(FSInputStream in, OutputStream out, long offset, long count) throws IOException { in.seek(offset); IOUtils.copyBytes(in, out, count, false); } }
StreamFile extends DfsServlet { static void copyFromOffset(FSInputStream in, OutputStream out, long offset, long count) throws IOException { in.seek(offset); IOUtils.copyBytes(in, out, count, false); } }
StreamFile extends DfsServlet { static void copyFromOffset(FSInputStream in, OutputStream out, long offset, long count) throws IOException { in.seek(offset); IOUtils.copyBytes(in, out, count, false); } @Override @SuppressWarnings("unchecked") void doGet(HttpServletRequest request, HttpServletResponse response); }
StreamFile extends DfsServlet { static void copyFromOffset(FSInputStream in, OutputStream out, long offset, long count) throws IOException { in.seek(offset); IOUtils.copyBytes(in, out, count, false); } @Override @SuppressWarnings("unchecked") void doGet(HttpServletRequest request, HttpServletResponse response); static...
@Test public void testSendPartialData() throws IOException { FSInputStream in = new MockFSInputStream(); ByteArrayOutputStream os = new ByteArrayOutputStream(); { List<InclusiveByteRange> ranges = strToRanges("0-,10-300", 500); HttpServletResponse response = Mockito.mock(HttpServletResponse.class); StreamFile.sendParti...
static void sendPartialData(FSInputStream in, OutputStream out, HttpServletResponse response, long contentLength, List<InclusiveByteRange> ranges) throws IOException { if (ranges == null || ranges.size() != 1) { response.setContentLength(0); response.setStatus(HttpServletResponse.SC_REQUESTED_RANGE_NOT_SATISFIABLE); re...
StreamFile extends DfsServlet { static void sendPartialData(FSInputStream in, OutputStream out, HttpServletResponse response, long contentLength, List<InclusiveByteRange> ranges) throws IOException { if (ranges == null || ranges.size() != 1) { response.setContentLength(0); response.setStatus(HttpServletResponse.SC_REQU...
StreamFile extends DfsServlet { static void sendPartialData(FSInputStream in, OutputStream out, HttpServletResponse response, long contentLength, List<InclusiveByteRange> ranges) throws IOException { if (ranges == null || ranges.size() != 1) { response.setContentLength(0); response.setStatus(HttpServletResponse.SC_REQU...
StreamFile extends DfsServlet { static void sendPartialData(FSInputStream in, OutputStream out, HttpServletResponse response, long contentLength, List<InclusiveByteRange> ranges) throws IOException { if (ranges == null || ranges.size() != 1) { response.setContentLength(0); response.setStatus(HttpServletResponse.SC_REQU...
StreamFile extends DfsServlet { static void sendPartialData(FSInputStream in, OutputStream out, HttpServletResponse response, long contentLength, List<InclusiveByteRange> ranges) throws IOException { if (ranges == null || ranges.size() != 1) { response.setContentLength(0); response.setStatus(HttpServletResponse.SC_REQU...
@Test public void testDoGetShouldWriteTheFileContentIntoServletOutputStream() throws Exception { MiniDFSCluster cluster = new MiniDFSCluster.Builder(CONF).numDataNodes(1) .build(); try { Path testFile = createFile(); setUpForDoGetTest(cluster, testFile); ServletOutputStreamExtn outStream = new ServletOutputStreamExtn()...
@Override @SuppressWarnings("unchecked") public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final String path = ServletUtil.getDecodedPath(request, "/streamFile"); final String rawPath = ServletUtil.getRawPath(request, "/streamFile"); final String filename...
StreamFile extends DfsServlet { @Override @SuppressWarnings("unchecked") public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final String path = ServletUtil.getDecodedPath(request, "/streamFile"); final String rawPath = ServletUtil.getRawPath(request, "/str...
StreamFile extends DfsServlet { @Override @SuppressWarnings("unchecked") public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final String path = ServletUtil.getDecodedPath(request, "/streamFile"); final String rawPath = ServletUtil.getRawPath(request, "/str...
StreamFile extends DfsServlet { @Override @SuppressWarnings("unchecked") public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final String path = ServletUtil.getDecodedPath(request, "/streamFile"); final String rawPath = ServletUtil.getRawPath(request, "/str...
StreamFile extends DfsServlet { @Override @SuppressWarnings("unchecked") public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final String path = ServletUtil.getDecodedPath(request, "/streamFile"); final String rawPath = ServletUtil.getRawPath(request, "/str...
@Test public void testDoGetShouldCloseTheDFSInputStreamIfResponseGetOutPutStreamThrowsAnyException() throws Exception { MiniDFSCluster cluster = new MiniDFSCluster.Builder(CONF).numDataNodes(1) .build(); try { Path testFile = createFile(); setUpForDoGetTest(cluster, testFile); Mockito.doThrow(new IOException()).when(mo...
@Override @SuppressWarnings("unchecked") public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final String path = ServletUtil.getDecodedPath(request, "/streamFile"); final String rawPath = ServletUtil.getRawPath(request, "/streamFile"); final String filename...
StreamFile extends DfsServlet { @Override @SuppressWarnings("unchecked") public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final String path = ServletUtil.getDecodedPath(request, "/streamFile"); final String rawPath = ServletUtil.getRawPath(request, "/str...
StreamFile extends DfsServlet { @Override @SuppressWarnings("unchecked") public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final String path = ServletUtil.getDecodedPath(request, "/streamFile"); final String rawPath = ServletUtil.getRawPath(request, "/str...
StreamFile extends DfsServlet { @Override @SuppressWarnings("unchecked") public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final String path = ServletUtil.getDecodedPath(request, "/streamFile"); final String rawPath = ServletUtil.getRawPath(request, "/str...
StreamFile extends DfsServlet { @Override @SuppressWarnings("unchecked") public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { final String path = ServletUtil.getDecodedPath(request, "/streamFile"); final String rawPath = ServletUtil.getRawPath(request, "/str...
@Test(expected=IllegalStateException.class) public void testFinalizeErrorReportedToNNStorage() throws IOException, InterruptedException { File f = new File(TestEditLog.TEST_DIR + "/filejournaltestError"); NNStorage storage = setupEdits(Collections.<URI>singletonList(f.toURI()), 10, new AbortSpec(10, 0)); StorageDirecto...
@Override synchronized public void finalizeLogSegment(long firstTxId, long lastTxId) throws IOException { File inprogressFile = NNStorage.getInProgressEditsFile(sd, firstTxId); File dstFile = NNStorage.getFinalizedEditsFile( sd, firstTxId, lastTxId); LOG.info("Finalizing edits file " + inprogressFile + " -> " + dstFile...
FileJournalManager implements JournalManager { @Override synchronized public void finalizeLogSegment(long firstTxId, long lastTxId) throws IOException { File inprogressFile = NNStorage.getInProgressEditsFile(sd, firstTxId); File dstFile = NNStorage.getFinalizedEditsFile( sd, firstTxId, lastTxId); LOG.info("Finalizing e...
FileJournalManager implements JournalManager { @Override synchronized public void finalizeLogSegment(long firstTxId, long lastTxId) throws IOException { File inprogressFile = NNStorage.getInProgressEditsFile(sd, firstTxId); File dstFile = NNStorage.getFinalizedEditsFile( sd, firstTxId, lastTxId); LOG.info("Finalizing e...
FileJournalManager implements JournalManager { @Override synchronized public void finalizeLogSegment(long firstTxId, long lastTxId) throws IOException { File inprogressFile = NNStorage.getInProgressEditsFile(sd, firstTxId); File dstFile = NNStorage.getFinalizedEditsFile( sd, firstTxId, lastTxId); LOG.info("Finalizing e...
FileJournalManager implements JournalManager { @Override synchronized public void finalizeLogSegment(long firstTxId, long lastTxId) throws IOException { File inprogressFile = NNStorage.getInProgressEditsFile(sd, firstTxId); File dstFile = NNStorage.getFinalizedEditsFile( sd, firstTxId, lastTxId); LOG.info("Finalizing e...
@Test(expected = IOException.class) public void testMatchEditLogInvalidDirThrowsIOException() throws IOException { File badDir = new File("does not exist"); FileJournalManager.matchEditLogs(badDir); }
public static List<EditLogFile> matchEditLogs(File logDir) throws IOException { return matchEditLogs(FileUtil.listFiles(logDir)); }
FileJournalManager implements JournalManager { public static List<EditLogFile> matchEditLogs(File logDir) throws IOException { return matchEditLogs(FileUtil.listFiles(logDir)); } }
FileJournalManager implements JournalManager { public static List<EditLogFile> matchEditLogs(File logDir) throws IOException { return matchEditLogs(FileUtil.listFiles(logDir)); } FileJournalManager(StorageDirectory sd, StorageErrorReporter errorReporter); }
FileJournalManager implements JournalManager { public static List<EditLogFile> matchEditLogs(File logDir) throws IOException { return matchEditLogs(FileUtil.listFiles(logDir)); } FileJournalManager(StorageDirectory sd, StorageErrorReporter errorReporter); @Override void close(); @Override void format(NamespaceInf...
FileJournalManager implements JournalManager { public static List<EditLogFile> matchEditLogs(File logDir) throws IOException { return matchEditLogs(FileUtil.listFiles(logDir)); } FileJournalManager(StorageDirectory sd, StorageErrorReporter errorReporter); @Override void close(); @Override void format(NamespaceInf...
@Test public void testDirectoryScanner() throws Exception { for (int parallelism = 1; parallelism < 3; parallelism++) { runTest(parallelism); } }
DirectoryScanner(DataNode dn, FsDatasetSpi<?> dataset, Configuration conf) { this.datanode = dn; this.dataset = dataset; int interval = conf.getInt(DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_KEY, DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_DEFAULT); scanPeriodMsecs = interval * 1000L; int threads = conf.ge...
DirectoryScanner implements Runnable { DirectoryScanner(DataNode dn, FsDatasetSpi<?> dataset, Configuration conf) { this.datanode = dn; this.dataset = dataset; int interval = conf.getInt(DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_KEY, DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_DEFAULT); scanPeriodMsecs = ...
DirectoryScanner implements Runnable { DirectoryScanner(DataNode dn, FsDatasetSpi<?> dataset, Configuration conf) { this.datanode = dn; this.dataset = dataset; int interval = conf.getInt(DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_KEY, DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_DEFAULT); scanPeriodMsecs = ...
DirectoryScanner implements Runnable { DirectoryScanner(DataNode dn, FsDatasetSpi<?> dataset, Configuration conf) { this.datanode = dn; this.dataset = dataset; int interval = conf.getInt(DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_KEY, DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_DEFAULT); scanPeriodMsecs = ...
DirectoryScanner implements Runnable { DirectoryScanner(DataNode dn, FsDatasetSpi<?> dataset, Configuration conf) { this.datanode = dn; this.dataset = dataset; int interval = conf.getInt(DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_KEY, DFSConfigKeys.DFS_DATANODE_DIRECTORYSCAN_INTERVAL_DEFAULT); scanPeriodMsecs = ...
@Test public void testRegisterFilter() { ParseFilter.registerFilter("MyFilter", "some.class"); assertTrue(f.getSupportedFilters().contains("MyFilter")); }
public static void registerFilter(String name, String filterClass) { if(LOG.isInfoEnabled()) LOG.info("Registering new filter " + name); filterHashMap.put(name, filterClass); }
ParseFilter { public static void registerFilter(String name, String filterClass) { if(LOG.isInfoEnabled()) LOG.info("Registering new filter " + name); filterHashMap.put(name, filterClass); } }
ParseFilter { public static void registerFilter(String name, String filterClass) { if(LOG.isInfoEnabled()) LOG.info("Registering new filter " + name); filterHashMap.put(name, filterClass); } }
ParseFilter { public static void registerFilter(String name, String filterClass) { if(LOG.isInfoEnabled()) LOG.info("Registering new filter " + name); filterHashMap.put(name, filterClass); } Filter parseFilterString(String filterString); Filter parseFilterString(byte [] filterStringAsByteArray); byte [] extractFilterS...
ParseFilter { public static void registerFilter(String name, String filterClass) { if(LOG.isInfoEnabled()) LOG.info("Registering new filter " + name); filterHashMap.put(name, filterClass); } Filter parseFilterString(String filterString); Filter parseFilterString(byte [] filterStringAsByteArray); byte [] extractFilterS...
@Test public void testFederationRefresh() throws Exception { Configuration conf = new Configuration(); conf.set(DFSConfigKeys.DFS_NAMESERVICES, "ns1,ns2"); addNN(conf, "ns1", "mock1:8020"); addNN(conf, "ns2", "mock1:8020"); bpm.refreshNamenodes(conf); assertEquals( "create #1\n" + "create #2\n", log.toString()); log.se...
void refreshNamenodes(Configuration conf) throws IOException { LOG.info("Refresh request received for nameservices: " + conf.get(DFSConfigKeys.DFS_NAMESERVICES)); Map<String, Map<String, InetSocketAddress>> newAddressMap = DFSUtil.getNNServiceRpcAddresses(conf); synchronized (refreshNamenodesLock) { doRefreshNamenodes(...
BlockPoolManager { void refreshNamenodes(Configuration conf) throws IOException { LOG.info("Refresh request received for nameservices: " + conf.get(DFSConfigKeys.DFS_NAMESERVICES)); Map<String, Map<String, InetSocketAddress>> newAddressMap = DFSUtil.getNNServiceRpcAddresses(conf); synchronized (refreshNamenodesLock) { ...
BlockPoolManager { void refreshNamenodes(Configuration conf) throws IOException { LOG.info("Refresh request received for nameservices: " + conf.get(DFSConfigKeys.DFS_NAMESERVICES)); Map<String, Map<String, InetSocketAddress>> newAddressMap = DFSUtil.getNNServiceRpcAddresses(conf); synchronized (refreshNamenodesLock) { ...
BlockPoolManager { void refreshNamenodes(Configuration conf) throws IOException { LOG.info("Refresh request received for nameservices: " + conf.get(DFSConfigKeys.DFS_NAMESERVICES)); Map<String, Map<String, InetSocketAddress>> newAddressMap = DFSUtil.getNNServiceRpcAddresses(conf); synchronized (refreshNamenodesLock) { ...
BlockPoolManager { void refreshNamenodes(Configuration conf) throws IOException { LOG.info("Refresh request received for nameservices: " + conf.get(DFSConfigKeys.DFS_NAMESERVICES)); Map<String, Map<String, InetSocketAddress>> newAddressMap = DFSUtil.getNNServiceRpcAddresses(conf); synchronized (refreshNamenodesLock) { ...
@Test public void testAccessTimeParam() { final AccessTimeParam p = new AccessTimeParam(AccessTimeParam.DEFAULT); Assert.assertEquals(-1L, p.getValue().longValue()); new AccessTimeParam(-1L); try { new AccessTimeParam(-2L); Assert.fail(); } catch(IllegalArgumentException e) { LOG.info("EXPECTED: " + e); } }
public final T getValue() { return value; }
Param { public final T getValue() { return value; } }
Param { public final T getValue() { return value; } Param(final D domain, final T value); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
@Test public void testBlockSizeParam() { final BlockSizeParam p = new BlockSizeParam(BlockSizeParam.DEFAULT); Assert.assertEquals(null, p.getValue()); Assert.assertEquals( conf.getLongBytes(DFSConfigKeys.DFS_BLOCK_SIZE_KEY, DFSConfigKeys.DFS_BLOCK_SIZE_DEFAULT), p.getValue(conf)); new BlockSizeParam(1L); try { new Bloc...
public final T getValue() { return value; }
Param { public final T getValue() { return value; } }
Param { public final T getValue() { return value; } Param(final D domain, final T value); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
@Test public void testColumnCountGetFilter() throws IOException { String family = "Family"; HTableDescriptor htd = new HTableDescriptor("testColumnCountGetFilter"); htd.addFamily(new HColumnDescriptor(family)); HRegionInfo info = new HRegionInfo(htd.getName(), null, null, false); HRegion region = HRegion.createHRegion(...
public ColumnCountGetFilter() { super(); }
ColumnCountGetFilter extends FilterBase { public ColumnCountGetFilter() { super(); } }
ColumnCountGetFilter extends FilterBase { public ColumnCountGetFilter() { super(); } ColumnCountGetFilter(); ColumnCountGetFilter(final int n); }
ColumnCountGetFilter extends FilterBase { public ColumnCountGetFilter() { super(); } ColumnCountGetFilter(); ColumnCountGetFilter(final int n); int getLimit(); @Override boolean filterAllRemaining(); @Override ReturnCode filterKeyValue(KeyValue v); @Override void reset(); static Filter createFilterFromArguments(ArrayL...
ColumnCountGetFilter extends FilterBase { public ColumnCountGetFilter() { super(); } ColumnCountGetFilter(); ColumnCountGetFilter(final int n); int getLimit(); @Override boolean filterAllRemaining(); @Override ReturnCode filterKeyValue(KeyValue v); @Override void reset(); static Filter createFilterFromArguments(ArrayL...
@Test public void testBufferSizeParam() { final BufferSizeParam p = new BufferSizeParam(BufferSizeParam.DEFAULT); Assert.assertEquals(null, p.getValue()); Assert.assertEquals( conf.getInt(CommonConfigurationKeysPublic.IO_FILE_BUFFER_SIZE_KEY, CommonConfigurationKeysPublic.IO_FILE_BUFFER_SIZE_DEFAULT), p.getValue(conf))...
public final T getValue() { return value; }
Param { public final T getValue() { return value; } }
Param { public final T getValue() { return value; } Param(final D domain, final T value); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
@Test public void testDelegationParam() { final DelegationParam p = new DelegationParam(DelegationParam.DEFAULT); Assert.assertEquals(null, p.getValue()); }
public final T getValue() { return value; }
Param { public final T getValue() { return value; } }
Param { public final T getValue() { return value; } Param(final D domain, final T value); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
@Test public void testDestinationParam() { final DestinationParam p = new DestinationParam(DestinationParam.DEFAULT); Assert.assertEquals(null, p.getValue()); new DestinationParam("/abc"); try { new DestinationParam("abc"); Assert.fail(); } catch(IllegalArgumentException e) { LOG.info("EXPECTED: " + e); } }
public final T getValue() { return value; }
Param { public final T getValue() { return value; } }
Param { public final T getValue() { return value; } Param(final D domain, final T value); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
@Test public void testGroupParam() { final GroupParam p = new GroupParam(GroupParam.DEFAULT); Assert.assertEquals(null, p.getValue()); }
public final T getValue() { return value; }
Param { public final T getValue() { return value; } }
Param { public final T getValue() { return value; } Param(final D domain, final T value); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
@Test public void testModificationTimeParam() { final ModificationTimeParam p = new ModificationTimeParam(ModificationTimeParam.DEFAULT); Assert.assertEquals(-1L, p.getValue().longValue()); new ModificationTimeParam(-1L); try { new ModificationTimeParam(-2L); Assert.fail(); } catch(IllegalArgumentException e) { LOG.inf...
public final T getValue() { return value; }
Param { public final T getValue() { return value; } }
Param { public final T getValue() { return value; } Param(final D domain, final T value); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
@Test public void testOverwriteParam() { final OverwriteParam p = new OverwriteParam(OverwriteParam.DEFAULT); Assert.assertEquals(false, p.getValue()); new OverwriteParam("trUe"); try { new OverwriteParam("abc"); Assert.fail(); } catch(IllegalArgumentException e) { LOG.info("EXPECTED: " + e); } }
public final T getValue() { return value; }
Param { public final T getValue() { return value; } }
Param { public final T getValue() { return value; } Param(final D domain, final T value); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
@Test public void testOwnerParam() { final OwnerParam p = new OwnerParam(OwnerParam.DEFAULT); Assert.assertEquals(null, p.getValue()); }
public final T getValue() { return value; }
Param { public final T getValue() { return value; } }
Param { public final T getValue() { return value; } Param(final D domain, final T value); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
@Test public void testRecursiveParam() { final RecursiveParam p = new RecursiveParam(RecursiveParam.DEFAULT); Assert.assertEquals(false, p.getValue()); new RecursiveParam("falSe"); try { new RecursiveParam("abc"); Assert.fail(); } catch(IllegalArgumentException e) { LOG.info("EXPECTED: " + e); } }
public final T getValue() { return value; }
Param { public final T getValue() { return value; } }
Param { public final T getValue() { return value; } Param(final D domain, final T value); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
@Test public void testRenewerParam() { final RenewerParam p = new RenewerParam(RenewerParam.DEFAULT); Assert.assertEquals(null, p.getValue()); }
public final T getValue() { return value; }
Param { public final T getValue() { return value; } }
Param { public final T getValue() { return value; } Param(final D domain, final T value); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
@Test public void testReplicationParam() { final ReplicationParam p = new ReplicationParam(ReplicationParam.DEFAULT); Assert.assertEquals(null, p.getValue()); Assert.assertEquals( (short)conf.getInt(DFSConfigKeys.DFS_REPLICATION_KEY, DFSConfigKeys.DFS_REPLICATION_DEFAULT), p.getValue(conf)); new ReplicationParam((short...
public final T getValue() { return value; }
Param { public final T getValue() { return value; } }
Param { public final T getValue() { return value; } Param(final D domain, final T value); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
@Test public void TestColumnRangeFilterClient() throws Exception { String family = "Family"; String table = "TestColumnRangeFilterClient"; HTable ht = TEST_UTIL.createTable(Bytes.toBytes(table), Bytes.toBytes(family), Integer.MAX_VALUE); List<String> rows = generateRandomWords(10, 8); long maxTimestamp = 2; List<String...
@Override public String toString() { return this.getClass().getSimpleName() + " " + (this.minColumnInclusive ? "[" : "(") + Bytes.toStringBinary(this.minColumn) + ", " + Bytes.toStringBinary(this.maxColumn) + (this.maxColumnInclusive ? "]" : ")"); }
ColumnRangeFilter extends FilterBase { @Override public String toString() { return this.getClass().getSimpleName() + " " + (this.minColumnInclusive ? "[" : "(") + Bytes.toStringBinary(this.minColumn) + ", " + Bytes.toStringBinary(this.maxColumn) + (this.maxColumnInclusive ? "]" : ")"); } }
ColumnRangeFilter extends FilterBase { @Override public String toString() { return this.getClass().getSimpleName() + " " + (this.minColumnInclusive ? "[" : "(") + Bytes.toStringBinary(this.minColumn) + ", " + Bytes.toStringBinary(this.maxColumn) + (this.maxColumnInclusive ? "]" : ")"); } ColumnRangeFilter(); ColumnRan...
ColumnRangeFilter extends FilterBase { @Override public String toString() { return this.getClass().getSimpleName() + " " + (this.minColumnInclusive ? "[" : "(") + Bytes.toStringBinary(this.minColumn) + ", " + Bytes.toStringBinary(this.maxColumn) + (this.maxColumnInclusive ? "]" : ")"); } ColumnRangeFilter(); ColumnRan...
ColumnRangeFilter extends FilterBase { @Override public String toString() { return this.getClass().getSimpleName() + " " + (this.minColumnInclusive ? "[" : "(") + Bytes.toStringBinary(this.minColumn) + ", " + Bytes.toStringBinary(this.maxColumn) + (this.maxColumnInclusive ? "]" : ")"); } ColumnRangeFilter(); ColumnRan...
@Test public void userNameEmpty() { UserParam userParam = new UserParam(""); assertNull(userParam.getValue()); }
public final T getValue() { return value; }
Param { public final T getValue() { return value; } }
Param { public final T getValue() { return value; } Param(final D domain, final T value); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
@Test public void userNameMinLength() { UserParam userParam = new UserParam("a"); assertNotNull(userParam.getValue()); }
public final T getValue() { return value; }
Param { public final T getValue() { return value; } }
Param { public final T getValue() { return value; } Param(final D domain, final T value); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
@Test public void userNameValidDollarSign() { UserParam userParam = new UserParam("a$"); assertNotNull(userParam.getValue()); }
public final T getValue() { return value; }
Param { public final T getValue() { return value; } }
Param { public final T getValue() { return value; } Param(final D domain, final T value); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
Param { public final T getValue() { return value; } Param(final D domain, final T value); static String toSortedString(final String separator, final Param<?, ?>... parameters); final T getValue(); abstract String getName(); @Override String toString(); }
@Test public void testGetConfiguration() throws ServletException { AuthFilter filter = new AuthFilter(); Map<String, String> m = new HashMap<String,String>(); m.put(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_PRINCIPAL_KEY, "xyz/thehost@REALM"); m.put(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY, "thekeyt...
@Override protected Properties getConfiguration(String prefix, FilterConfig config) throws ServletException { final Properties p = super.getConfiguration(CONF_PREFIX, config); p.setProperty(AUTH_TYPE, UserGroupInformation.isSecurityEnabled()? KerberosAuthenticationHandler.TYPE: PseudoAuthenticationHandler.TYPE); p.setP...
AuthFilter extends AuthenticationFilter { @Override protected Properties getConfiguration(String prefix, FilterConfig config) throws ServletException { final Properties p = super.getConfiguration(CONF_PREFIX, config); p.setProperty(AUTH_TYPE, UserGroupInformation.isSecurityEnabled()? KerberosAuthenticationHandler.TYPE:...
AuthFilter extends AuthenticationFilter { @Override protected Properties getConfiguration(String prefix, FilterConfig config) throws ServletException { final Properties p = super.getConfiguration(CONF_PREFIX, config); p.setProperty(AUTH_TYPE, UserGroupInformation.isSecurityEnabled()? KerberosAuthenticationHandler.TYPE:...
AuthFilter extends AuthenticationFilter { @Override protected Properties getConfiguration(String prefix, FilterConfig config) throws ServletException { final Properties p = super.getConfiguration(CONF_PREFIX, config); p.setProperty(AUTH_TYPE, UserGroupInformation.isSecurityEnabled()? KerberosAuthenticationHandler.TYPE:...
AuthFilter extends AuthenticationFilter { @Override protected Properties getConfiguration(String prefix, FilterConfig config) throws ServletException { final Properties p = super.getConfiguration(CONF_PREFIX, config); p.setProperty(AUTH_TYPE, UserGroupInformation.isSecurityEnabled()? KerberosAuthenticationHandler.TYPE:...
@Test public void testStablePositionAfterCorruptRead() throws Exception { final short REPL_FACTOR = 1; final long FILE_LENGTH = 512L; HdfsConfiguration conf = getConfiguration(null); MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(1).build(); cluster.waitActive(); FileSystem fs = cluster.getFileS...
@Override public synchronized int read(ByteBuffer buf) throws IOException { int nRead = 0; if (verifyChecksum) { if (slowReadBuff.hasRemaining()) { int fromSlowReadBuff = Math.min(buf.remaining(), slowReadBuff.remaining()); writeSlice(slowReadBuff, buf, fromSlowReadBuff); nRead += fromSlowReadBuff; } if (buf.remaining(...
BlockReaderLocalLegacy implements BlockReader { @Override public synchronized int read(ByteBuffer buf) throws IOException { int nRead = 0; if (verifyChecksum) { if (slowReadBuff.hasRemaining()) { int fromSlowReadBuff = Math.min(buf.remaining(), slowReadBuff.remaining()); writeSlice(slowReadBuff, buf, fromSlowReadBuff);...
BlockReaderLocalLegacy implements BlockReader { @Override public synchronized int read(ByteBuffer buf) throws IOException { int nRead = 0; if (verifyChecksum) { if (slowReadBuff.hasRemaining()) { int fromSlowReadBuff = Math.min(buf.remaining(), slowReadBuff.remaining()); writeSlice(slowReadBuff, buf, fromSlowReadBuff);...
BlockReaderLocalLegacy implements BlockReader { @Override public synchronized int read(ByteBuffer buf) throws IOException { int nRead = 0; if (verifyChecksum) { if (slowReadBuff.hasRemaining()) { int fromSlowReadBuff = Math.min(buf.remaining(), slowReadBuff.remaining()); writeSlice(slowReadBuff, buf, fromSlowReadBuff);...
BlockReaderLocalLegacy implements BlockReader { @Override public synchronized int read(ByteBuffer buf) throws IOException { int nRead = 0; if (verifyChecksum) { if (slowReadBuff.hasRemaining()) { int fromSlowReadBuff = Math.min(buf.remaining(), slowReadBuff.remaining()); writeSlice(slowReadBuff, buf, fromSlowReadBuff);...
@Test public void testOneBookieFailure() throws Exception { BookieServer bookieToFail = bkutil.newBookie(); BookieServer replacementBookie = null; try { int ensembleSize = numBookies + 1; assertEquals("New bookie didn't start", ensembleSize, bkutil.checkBookiesUp(ensembleSize, 10)); Configuration conf = new Configurati...
@Override public EditLogOutputStream startLogSegment(long txId) throws IOException { if (txId <= maxTxId.get()) { throw new IOException("We've already seen " + txId + ". A new stream cannot be created with it"); } try { String existingInprogressNode = ci.read(); if (null != existingInprogressNode && zkc.exists(existing...
BookKeeperJournalManager implements JournalManager { @Override public EditLogOutputStream startLogSegment(long txId) throws IOException { if (txId <= maxTxId.get()) { throw new IOException("We've already seen " + txId + ". A new stream cannot be created with it"); } try { String existingInprogressNode = ci.read(); if (...
BookKeeperJournalManager implements JournalManager { @Override public EditLogOutputStream startLogSegment(long txId) throws IOException { if (txId <= maxTxId.get()) { throw new IOException("We've already seen " + txId + ". A new stream cannot be created with it"); } try { String existingInprogressNode = ci.read(); if (...
BookKeeperJournalManager implements JournalManager { @Override public EditLogOutputStream startLogSegment(long txId) throws IOException { if (txId <= maxTxId.get()) { throw new IOException("We've already seen " + txId + ". A new stream cannot be created with it"); } try { String existingInprogressNode = ci.read(); if (...
BookKeeperJournalManager implements JournalManager { @Override public EditLogOutputStream startLogSegment(long txId) throws IOException { if (txId <= maxTxId.get()) { throw new IOException("We've already seen " + txId + ". A new stream cannot be created with it"); } try { String existingInprogressNode = ci.read(); if (...
@Test @TestDir @TestJetty @TestHdfs public void testGlobFilter() throws Exception { createHttpFSServer(false); FileSystem fs = FileSystem.get(TestHdfsHelper.getHdfsConf()); fs.mkdirs(new Path("/tmp")); fs.create(new Path("/tmp/foo.txt")).close(); String user = HadoopUsersConfTestHelper.getHadoopUsers()[0]; URL url = ne...
@GET @Path("{path:.*}") @Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON}) public Response get(@Context Principal user, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, @Context Parameters params) throws IOException, FileSystemAccessException { Response respon...
HttpFSServer { @GET @Path("{path:.*}") @Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON}) public Response get(@Context Principal user, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, @Context Parameters params) throws IOException, FileSystemAccessException { ...
HttpFSServer { @GET @Path("{path:.*}") @Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON}) public Response get(@Context Principal user, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, @Context Parameters params) throws IOException, FileSystemAccessException { ...
HttpFSServer { @GET @Path("{path:.*}") @Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON}) public Response get(@Context Principal user, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, @Context Parameters params) throws IOException, FileSystemAccessException { ...
HttpFSServer { @GET @Path("{path:.*}") @Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON}) public Response get(@Context Principal user, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, @Context Parameters params) throws IOException, FileSystemAccessException { ...
@Test @TestDir @TestJetty @TestHdfs public void testOpenOffsetLength() throws Exception { createHttpFSServer(false); byte[] array = new byte[]{0, 1, 2, 3}; FileSystem fs = FileSystem.get(TestHdfsHelper.getHdfsConf()); fs.mkdirs(new Path("/tmp")); OutputStream os = fs.create(new Path("/tmp/foo")); os.write(array); os.cl...
@GET @Path("{path:.*}") @Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON}) public Response get(@Context Principal user, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, @Context Parameters params) throws IOException, FileSystemAccessException { Response respon...
HttpFSServer { @GET @Path("{path:.*}") @Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON}) public Response get(@Context Principal user, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, @Context Parameters params) throws IOException, FileSystemAccessException { ...
HttpFSServer { @GET @Path("{path:.*}") @Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON}) public Response get(@Context Principal user, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, @Context Parameters params) throws IOException, FileSystemAccessException { ...
HttpFSServer { @GET @Path("{path:.*}") @Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON}) public Response get(@Context Principal user, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, @Context Parameters params) throws IOException, FileSystemAccessException { ...
HttpFSServer { @GET @Path("{path:.*}") @Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON}) public Response get(@Context Principal user, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, @Context Parameters params) throws IOException, FileSystemAccessException { ...
@Test @TestDir @TestJetty @TestHdfs public void testDelegationTokenOperations() throws Exception { createHttpFSServer(true); URL url = new URL(TestJettyHelper.getJettyURL(), "/webhdfs/v1/?op=GETHOMEDIRECTORY"); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); Assert.assertEquals(HttpURLConnection.HTTP...
@GET @Path("{path:.*}") @Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON}) public Response get(@Context Principal user, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, @Context Parameters params) throws IOException, FileSystemAccessException { Response respon...
HttpFSServer { @GET @Path("{path:.*}") @Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON}) public Response get(@Context Principal user, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, @Context Parameters params) throws IOException, FileSystemAccessException { ...
HttpFSServer { @GET @Path("{path:.*}") @Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON}) public Response get(@Context Principal user, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, @Context Parameters params) throws IOException, FileSystemAccessException { ...
HttpFSServer { @GET @Path("{path:.*}") @Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON}) public Response get(@Context Principal user, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, @Context Parameters params) throws IOException, FileSystemAccessException { ...
HttpFSServer { @GET @Path("{path:.*}") @Produces({MediaType.APPLICATION_OCTET_STREAM, MediaType.APPLICATION_JSON}) public Response get(@Context Principal user, @PathParam("path") String path, @QueryParam(OperationParam.NAME) OperationParam op, @Context Parameters params) throws IOException, FileSystemAccessException { ...
@Test public void testColumnPrefixFilter() throws IOException { String family = "Family"; HTableDescriptor htd = new HTableDescriptor("TestColumnPrefixFilter"); htd.addFamily(new HColumnDescriptor(family)); HRegionInfo info = new HRegionInfo(htd.getName(), null, null, false); HRegion region = HRegion.createHRegion(info...
public ColumnPrefixFilter() { super(); }
ColumnPrefixFilter extends FilterBase { public ColumnPrefixFilter() { super(); } }
ColumnPrefixFilter extends FilterBase { public ColumnPrefixFilter() { super(); } ColumnPrefixFilter(); ColumnPrefixFilter(final byte [] prefix); }
ColumnPrefixFilter extends FilterBase { public ColumnPrefixFilter() { super(); } ColumnPrefixFilter(); ColumnPrefixFilter(final byte [] prefix); byte[] getPrefix(); @Override ReturnCode filterKeyValue(KeyValue kv); ReturnCode filterColumn(byte[] buffer, int qualifierOffset, int qualifierLength); static Filter createFi...
ColumnPrefixFilter extends FilterBase { public ColumnPrefixFilter() { super(); } ColumnPrefixFilter(); ColumnPrefixFilter(final byte [] prefix); byte[] getPrefix(); @Override ReturnCode filterKeyValue(KeyValue kv); ReturnCode filterColumn(byte[] buffer, int qualifierOffset, int qualifierLength); static Filter createFi...
@Test public void testMultipleColumnPrefixFilter() throws IOException { String family = "Family"; HTableDescriptor htd = new HTableDescriptor("TestMultipleColumnPrefixFilter"); htd.addFamily(new HColumnDescriptor(family)); HRegionInfo info = new HRegionInfo(htd.getName(), null, null, false); HRegion region = HRegion.cr...
public MultipleColumnPrefixFilter() { super(); }
MultipleColumnPrefixFilter extends FilterBase { public MultipleColumnPrefixFilter() { super(); } }
MultipleColumnPrefixFilter extends FilterBase { public MultipleColumnPrefixFilter() { super(); } MultipleColumnPrefixFilter(); MultipleColumnPrefixFilter(final byte [][] prefixes); }
MultipleColumnPrefixFilter extends FilterBase { public MultipleColumnPrefixFilter() { super(); } MultipleColumnPrefixFilter(); MultipleColumnPrefixFilter(final byte [][] prefixes); byte [][] getPrefix(); @Override ReturnCode filterKeyValue(KeyValue kv); ReturnCode filterColumn(byte[] buffer, int qualifierOffset, int q...
MultipleColumnPrefixFilter extends FilterBase { public MultipleColumnPrefixFilter() { super(); } MultipleColumnPrefixFilter(); MultipleColumnPrefixFilter(final byte [][] prefixes); byte [][] getPrefix(); @Override ReturnCode filterKeyValue(KeyValue kv); ReturnCode filterColumn(byte[] buffer, int qualifierOffset, int q...
@Test public void testLocalHBaseCluster() throws Exception { Configuration conf = TEST_UTIL.getConfiguration(); conf.set(HConstants.HBASE_DIR, TEST_UTIL.getDataTestDir("hbase.rootdir"). makeQualified(TEST_UTIL.getTestFileSystem().getUri(), TEST_UTIL.getTestFileSystem().getWorkingDirectory()).toString()); MiniZooKeeperC...
public LocalHBaseCluster(final Configuration conf) throws IOException { this(conf, DEFAULT_NO); }
LocalHBaseCluster { public LocalHBaseCluster(final Configuration conf) throws IOException { this(conf, DEFAULT_NO); } }
LocalHBaseCluster { public LocalHBaseCluster(final Configuration conf) throws IOException { this(conf, DEFAULT_NO); } LocalHBaseCluster(final Configuration conf); LocalHBaseCluster(final Configuration conf, final int noRegionServers); LocalHBaseCluster(final Configuration conf, final int noMasters, final int no...
LocalHBaseCluster { public LocalHBaseCluster(final Configuration conf) throws IOException { this(conf, DEFAULT_NO); } LocalHBaseCluster(final Configuration conf); LocalHBaseCluster(final Configuration conf, final int noRegionServers); LocalHBaseCluster(final Configuration conf, final int noMasters, final int no...
LocalHBaseCluster { public LocalHBaseCluster(final Configuration conf) throws IOException { this(conf, DEFAULT_NO); } LocalHBaseCluster(final Configuration conf); LocalHBaseCluster(final Configuration conf, final int noRegionServers); LocalHBaseCluster(final Configuration conf, final int noMasters, final int no...
@Test(expected = RuntimeException.class) public void callableExRun() throws Exception { CEx c = new CEx(); RunnableCallable rc = new RunnableCallable(c); rc.run(); }
@Override public void run() { if (runnable != null) { runnable.run(); } else { try { callable.call(); } catch (Exception ex) { throw new RuntimeException(ex); } } }
RunnableCallable implements Callable<Void>, Runnable { @Override public void run() { if (runnable != null) { runnable.run(); } else { try { callable.call(); } catch (Exception ex) { throw new RuntimeException(ex); } } } }
RunnableCallable implements Callable<Void>, Runnable { @Override public void run() { if (runnable != null) { runnable.run(); } else { try { callable.call(); } catch (Exception ex) { throw new RuntimeException(ex); } } } RunnableCallable(Runnable runnable); RunnableCallable(Callable<?> callable); }
RunnableCallable implements Callable<Void>, Runnable { @Override public void run() { if (runnable != null) { runnable.run(); } else { try { callable.call(); } catch (Exception ex) { throw new RuntimeException(ex); } } } RunnableCallable(Runnable runnable); RunnableCallable(Callable<?> callable); @Override Void call();...
RunnableCallable implements Callable<Void>, Runnable { @Override public void run() { if (runnable != null) { runnable.run(); } else { try { callable.call(); } catch (Exception ex) { throw new RuntimeException(ex); } } } RunnableCallable(Runnable runnable); RunnableCallable(Callable<?> callable); @Override Void call();...
@Test public void sampler() throws Exception { final long value[] = new long[1]; Instrumentation.Variable<Long> var = new Instrumentation.Variable<Long>() { @Override public Long getValue() { return value[0]; } }; InstrumentationService.Sampler sampler = new InstrumentationService.Sampler(); sampler.init(4, var); asser...
@Override @SuppressWarnings("unchecked") public void init() throws ServiceException { timersSize = getServiceConfig().getInt(CONF_TIMERS_SIZE, 10); counterLock = new ReentrantLock(); timerLock = new ReentrantLock(); variableLock = new ReentrantLock(); samplerLock = new ReentrantLock(); Map<String, VariableHolder> jvmVa...
InstrumentationService extends BaseService implements Instrumentation { @Override @SuppressWarnings("unchecked") public void init() throws ServiceException { timersSize = getServiceConfig().getInt(CONF_TIMERS_SIZE, 10); counterLock = new ReentrantLock(); timerLock = new ReentrantLock(); variableLock = new ReentrantLock...
InstrumentationService extends BaseService implements Instrumentation { @Override @SuppressWarnings("unchecked") public void init() throws ServiceException { timersSize = getServiceConfig().getInt(CONF_TIMERS_SIZE, 10); counterLock = new ReentrantLock(); timerLock = new ReentrantLock(); variableLock = new ReentrantLock...
InstrumentationService extends BaseService implements Instrumentation { @Override @SuppressWarnings("unchecked") public void init() throws ServiceException { timersSize = getServiceConfig().getInt(CONF_TIMERS_SIZE, 10); counterLock = new ReentrantLock(); timerLock = new ReentrantLock(); variableLock = new ReentrantLock...
InstrumentationService extends BaseService implements Instrumentation { @Override @SuppressWarnings("unchecked") public void init() throws ServiceException { timersSize = getServiceConfig().getInt(CONF_TIMERS_SIZE, 10); counterLock = new ReentrantLock(); timerLock = new ReentrantLock(); variableLock = new ReentrantLock...
@Test public void testRunAs() throws Exception { Configuration conf = HBaseConfiguration.create(); final User user = User.createUserForTesting(conf, "testuser", new String[]{"foo"}); final PrivilegedExceptionAction<String> action = new PrivilegedExceptionAction<String>(){ public String run() throws IOException { User u...
public abstract <T> T runAs(PrivilegedAction<T> action);
User { public abstract <T> T runAs(PrivilegedAction<T> action); }
User { public abstract <T> T runAs(PrivilegedAction<T> action); }
User { public abstract <T> T runAs(PrivilegedAction<T> action); UserGroupInformation getUGI(); String getName(); String[] getGroupNames(); abstract String getShortName(); abstract T runAs(PrivilegedAction<T> action); abstract T runAs(PrivilegedExceptionAction<T> action); abstract void obtainAuthTokenForJob(Configurati...
User { public abstract <T> T runAs(PrivilegedAction<T> action); UserGroupInformation getUGI(); String getName(); String[] getGroupNames(); abstract String getShortName(); abstract T runAs(PrivilegedAction<T> action); abstract T runAs(PrivilegedExceptionAction<T> action); abstract void obtainAuthTokenForJob(Configurati...
@Test @TestDir public void simpleSecurity() throws Exception { String dir = TestDirHelper.getTestDir().getAbsolutePath(); String services = StringUtils.join(",", Arrays.asList(InstrumentationService.class.getName(), SchedulerService.class.getName(), FileSystemAccessService.class.getName())); Configuration conf = new Co...
@Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerberos")) { String defaultName = getServer().getName(); String keytab = System....
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
@Test @TestException(exception = ServiceException.class, msgRegExp = "H01.*") @TestDir public void noKerberosKeytabProperty() throws Exception { String dir = TestDirHelper.getTestDir().getAbsolutePath(); String services = StringUtils.join(",", Arrays.asList(InstrumentationService.class.getName(), SchedulerService.class...
@Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerberos")) { String defaultName = getServer().getName(); String keytab = System....
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
@Test @TestException(exception = ServiceException.class, msgRegExp = "H01.*") @TestDir public void noKerberosPrincipalProperty() throws Exception { String dir = TestDirHelper.getTestDir().getAbsolutePath(); String services = StringUtils.join(",", Arrays.asList(InstrumentationService.class.getName(), SchedulerService.cl...
@Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerberos")) { String defaultName = getServer().getName(); String keytab = System....
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
@Test @TestException(exception = ServiceException.class, msgRegExp = "H02.*") @TestDir public void kerberosInitializationFailure() throws Exception { String dir = TestDirHelper.getTestDir().getAbsolutePath(); String services = StringUtils.join(",", Arrays.asList(InstrumentationService.class.getName(), SchedulerService....
@Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerberos")) { String defaultName = getServer().getName(); String keytab = System....
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
@Test public void testGetCurrent() throws Exception { User user1 = User.getCurrent(); assertNotNull(user1.ugi); LOG.debug("User1 is "+user1.getName()); for (int i =0 ; i< 100; i++) { User u = User.getCurrent(); assertNotNull(u); assertEquals(user1.getName(), u.getName()); } }
public static User getCurrent() throws IOException { User user; if (IS_SECURE_HADOOP) { user = new SecureHadoopUser(); } else { user = new HadoopUser(); } if (user.getUGI() == null) { return null; } return user; }
User { public static User getCurrent() throws IOException { User user; if (IS_SECURE_HADOOP) { user = new SecureHadoopUser(); } else { user = new HadoopUser(); } if (user.getUGI() == null) { return null; } return user; } }
User { public static User getCurrent() throws IOException { User user; if (IS_SECURE_HADOOP) { user = new SecureHadoopUser(); } else { user = new HadoopUser(); } if (user.getUGI() == null) { return null; } return user; } }
User { public static User getCurrent() throws IOException { User user; if (IS_SECURE_HADOOP) { user = new SecureHadoopUser(); } else { user = new HadoopUser(); } if (user.getUGI() == null) { return null; } return user; } UserGroupInformation getUGI(); String getName(); String[] getGroupNames(); abstract String getShor...
User { public static User getCurrent() throws IOException { User user; if (IS_SECURE_HADOOP) { user = new SecureHadoopUser(); } else { user = new HadoopUser(); } if (user.getUGI() == null) { return null; } return user; } UserGroupInformation getUGI(); String getName(); String[] getGroupNames(); abstract String getShor...
@Test public void testGetStorageClusterVersionXML() throws IOException, JAXBException { Response response = client.get("/version/cluster",Constants.MIMETYPE_XML); assertTrue(response.getCode() == 200); assertEquals(Constants.MIMETYPE_XML, response.getHeader("content-type")); StorageClusterVersionModel clusterVersionMod...
@GET @Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context ServletContext context, final @Context UriInfo uriInfo) { if (LOG.isDebugEnabled()) { LOG.debug("GET " + uriInfo.getAbsolutePath()); } servlet.getMetrics().incrementRequests(1); Res...
VersionResource extends ResourceBase { @GET @Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context ServletContext context, final @Context UriInfo uriInfo) { if (LOG.isDebugEnabled()) { LOG.debug("GET " + uriInfo.getAbsolutePath()); } servlet...
VersionResource extends ResourceBase { @GET @Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context ServletContext context, final @Context UriInfo uriInfo) { if (LOG.isDebugEnabled()) { LOG.debug("GET " + uriInfo.getAbsolutePath()); } servlet...
VersionResource extends ResourceBase { @GET @Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context ServletContext context, final @Context UriInfo uriInfo) { if (LOG.isDebugEnabled()) { LOG.debug("GET " + uriInfo.getAbsolutePath()); } servlet...
VersionResource extends ResourceBase { @GET @Produces({MIMETYPE_TEXT, MIMETYPE_XML, MIMETYPE_JSON, MIMETYPE_PROTOBUF, MIMETYPE_PROTOBUF_IETF}) public Response get(final @Context ServletContext context, final @Context UriInfo uriInfo) { if (LOG.isDebugEnabled()) { LOG.debug("GET " + uriInfo.getAbsolutePath()); } servlet...
@Test @TestException(exception = ServiceException.class, msgRegExp = "H09.*") @TestDir public void invalidSecurity() throws Exception { String dir = TestDirHelper.getTestDir().getAbsolutePath(); String services = StringUtils.join(",", Arrays.asList(InstrumentationService.class.getName(), SchedulerService.class.getName(...
@Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerberos")) { String defaultName = getServer().getName(); String keytab = System....
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
@Test @TestDir public void serviceHadoopConf() throws Exception { String dir = TestDirHelper.getTestDir().getAbsolutePath(); String services = StringUtils.join(",", Arrays.asList(InstrumentationService.class.getName(), SchedulerService.class.getName(), FileSystemAccessService.class.getName())); Configuration conf = new...
@Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerberos")) { String defaultName = getServer().getName(); String keytab = System....
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
@Test @TestDir public void serviceHadoopConfCustomDir() throws Exception { String dir = TestDirHelper.getTestDir().getAbsolutePath(); String hadoopConfDir = new File(dir, "confx").getAbsolutePath(); new File(hadoopConfDir).mkdirs(); String services = StringUtils.join(",", Arrays.asList(InstrumentationService.class.getN...
@Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerberos")) { String defaultName = getServer().getName(); String keytab = System....
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
FileSystemAccessService extends BaseService implements FileSystemAccess { @Override protected void init() throws ServiceException { LOG.info("Using FileSystemAccess JARs version [{}]", VersionInfo.getVersion()); String security = getServiceConfig().get(AUTHENTICATION_TYPE, "simple").trim(); if (security.equals("kerbero...
@Test @TestDir @TestHdfs public void createFileSystem() throws Exception { String dir = TestDirHelper.getTestDir().getAbsolutePath(); String services = StringUtils.join(",", Arrays.asList(InstrumentationService.class.getName(), SchedulerService.class.getName(), FileSystemAccessService.class.getName())); Configuration h...
protected FileSystem createFileSystem(Configuration namenodeConf) throws IOException { String user = UserGroupInformation.getCurrentUser().getShortUserName(); CachedFileSystem newCachedFS = new CachedFileSystem(purgeTimeout); CachedFileSystem cachedFS = fsCache.putIfAbsent(user, newCachedFS); if (cachedFS == null) { ca...
FileSystemAccessService extends BaseService implements FileSystemAccess { protected FileSystem createFileSystem(Configuration namenodeConf) throws IOException { String user = UserGroupInformation.getCurrentUser().getShortUserName(); CachedFileSystem newCachedFS = new CachedFileSystem(purgeTimeout); CachedFileSystem cac...
FileSystemAccessService extends BaseService implements FileSystemAccess { protected FileSystem createFileSystem(Configuration namenodeConf) throws IOException { String user = UserGroupInformation.getCurrentUser().getShortUserName(); CachedFileSystem newCachedFS = new CachedFileSystem(purgeTimeout); CachedFileSystem cac...
FileSystemAccessService extends BaseService implements FileSystemAccess { protected FileSystem createFileSystem(Configuration namenodeConf) throws IOException { String user = UserGroupInformation.getCurrentUser().getShortUserName(); CachedFileSystem newCachedFS = new CachedFileSystem(purgeTimeout); CachedFileSystem cac...
FileSystemAccessService extends BaseService implements FileSystemAccess { protected FileSystem createFileSystem(Configuration namenodeConf) throws IOException { String user = UserGroupInformation.getCurrentUser().getShortUserName(); CachedFileSystem newCachedFS = new CachedFileSystem(purgeTimeout); CachedFileSystem cac...
@Test(expected = IllegalArgumentException.class) public void getHomeDirNotDef() { ServerWebApp.getHomeDir("TestServerWebApp00"); }
static String getHomeDir(String name) { String homeDir = HOME_DIR_TL.get(); if (homeDir == null) { String sysProp = name + HOME_DIR; homeDir = System.getProperty(sysProp); if (homeDir == null) { throw new IllegalArgumentException(MessageFormat.format("System property [{0}] not defined", sysProp)); } } return homeDir; }
ServerWebApp extends Server implements ServletContextListener { static String getHomeDir(String name) { String homeDir = HOME_DIR_TL.get(); if (homeDir == null) { String sysProp = name + HOME_DIR; homeDir = System.getProperty(sysProp); if (homeDir == null) { throw new IllegalArgumentException(MessageFormat.format("Syst...
ServerWebApp extends Server implements ServletContextListener { static String getHomeDir(String name) { String homeDir = HOME_DIR_TL.get(); if (homeDir == null) { String sysProp = name + HOME_DIR; homeDir = System.getProperty(sysProp); if (homeDir == null) { throw new IllegalArgumentException(MessageFormat.format("Syst...
ServerWebApp extends Server implements ServletContextListener { static String getHomeDir(String name) { String homeDir = HOME_DIR_TL.get(); if (homeDir == null) { String sysProp = name + HOME_DIR; homeDir = System.getProperty(sysProp); if (homeDir == null) { throw new IllegalArgumentException(MessageFormat.format("Syst...
ServerWebApp extends Server implements ServletContextListener { static String getHomeDir(String name) { String homeDir = HOME_DIR_TL.get(); if (homeDir == null) { String sysProp = name + HOME_DIR; homeDir = System.getProperty(sysProp); if (homeDir == null) { throw new IllegalArgumentException(MessageFormat.format("Syst...
@Test public void getHomeDir() { System.setProperty("TestServerWebApp0.home.dir", "/tmp"); assertEquals(ServerWebApp.getHomeDir("TestServerWebApp0"), "/tmp"); assertEquals(ServerWebApp.getDir("TestServerWebApp0", ".log.dir", "/tmp/log"), "/tmp/log"); System.setProperty("TestServerWebApp0.log.dir", "/tmplog"); assertEqu...
static String getHomeDir(String name) { String homeDir = HOME_DIR_TL.get(); if (homeDir == null) { String sysProp = name + HOME_DIR; homeDir = System.getProperty(sysProp); if (homeDir == null) { throw new IllegalArgumentException(MessageFormat.format("System property [{0}] not defined", sysProp)); } } return homeDir; }
ServerWebApp extends Server implements ServletContextListener { static String getHomeDir(String name) { String homeDir = HOME_DIR_TL.get(); if (homeDir == null) { String sysProp = name + HOME_DIR; homeDir = System.getProperty(sysProp); if (homeDir == null) { throw new IllegalArgumentException(MessageFormat.format("Syst...
ServerWebApp extends Server implements ServletContextListener { static String getHomeDir(String name) { String homeDir = HOME_DIR_TL.get(); if (homeDir == null) { String sysProp = name + HOME_DIR; homeDir = System.getProperty(sysProp); if (homeDir == null) { throw new IllegalArgumentException(MessageFormat.format("Syst...
ServerWebApp extends Server implements ServletContextListener { static String getHomeDir(String name) { String homeDir = HOME_DIR_TL.get(); if (homeDir == null) { String sysProp = name + HOME_DIR; homeDir = System.getProperty(sysProp); if (homeDir == null) { throw new IllegalArgumentException(MessageFormat.format("Syst...
ServerWebApp extends Server implements ServletContextListener { static String getHomeDir(String name) { String homeDir = HOME_DIR_TL.get(); if (homeDir == null) { String sysProp = name + HOME_DIR; homeDir = System.getProperty(sysProp); if (homeDir == null) { throw new IllegalArgumentException(MessageFormat.format("Syst...
@Test(expected = RuntimeException.class) @TestDir public void failedInit() throws Exception { String dir = TestDirHelper.getTestDir().getAbsolutePath(); System.setProperty("TestServerWebApp2.home.dir", dir); System.setProperty("TestServerWebApp2.config.dir", dir); System.setProperty("TestServerWebApp2.log.dir", dir); S...
public void contextInitialized(ServletContextEvent event) { try { init(); } catch (ServerException ex) { event.getServletContext().log("ERROR: " + ex.getMessage()); throw new RuntimeException(ex); } }
ServerWebApp extends Server implements ServletContextListener { public void contextInitialized(ServletContextEvent event) { try { init(); } catch (ServerException ex) { event.getServletContext().log("ERROR: " + ex.getMessage()); throw new RuntimeException(ex); } } }
ServerWebApp extends Server implements ServletContextListener { public void contextInitialized(ServletContextEvent event) { try { init(); } catch (ServerException ex) { event.getServletContext().log("ERROR: " + ex.getMessage()); throw new RuntimeException(ex); } } protected ServerWebApp(String name, String homeDir, St...
ServerWebApp extends Server implements ServletContextListener { public void contextInitialized(ServletContextEvent event) { try { init(); } catch (ServerException ex) { event.getServletContext().log("ERROR: " + ex.getMessage()); throw new RuntimeException(ex); } } protected ServerWebApp(String name, String homeDir, St...
ServerWebApp extends Server implements ServletContextListener { public void contextInitialized(ServletContextEvent event) { try { init(); } catch (ServerException ex) { event.getServletContext().log("ERROR: " + ex.getMessage()); throw new RuntimeException(ex); } } protected ServerWebApp(String name, String homeDir, St...
@Test @TestDir public void testResolveAuthority() throws Exception { String dir = TestDirHelper.getTestDir().getAbsolutePath(); System.setProperty("TestServerWebApp3.home.dir", dir); System.setProperty("TestServerWebApp3.config.dir", dir); System.setProperty("TestServerWebApp3.log.dir", dir); System.setProperty("TestSe...
protected InetSocketAddress resolveAuthority() throws ServerException { String hostnameKey = getName() + HTTP_HOSTNAME; String portKey = getName() + HTTP_PORT; String host = System.getProperty(hostnameKey); String port = System.getProperty(portKey); if (host == null) { throw new ServerException(ServerException.ERROR.S1...
ServerWebApp extends Server implements ServletContextListener { protected InetSocketAddress resolveAuthority() throws ServerException { String hostnameKey = getName() + HTTP_HOSTNAME; String portKey = getName() + HTTP_PORT; String host = System.getProperty(hostnameKey); String port = System.getProperty(portKey); if (ho...
ServerWebApp extends Server implements ServletContextListener { protected InetSocketAddress resolveAuthority() throws ServerException { String hostnameKey = getName() + HTTP_HOSTNAME; String portKey = getName() + HTTP_PORT; String host = System.getProperty(hostnameKey); String port = System.getProperty(portKey); if (ho...
ServerWebApp extends Server implements ServletContextListener { protected InetSocketAddress resolveAuthority() throws ServerException { String hostnameKey = getName() + HTTP_HOSTNAME; String portKey = getName() + HTTP_PORT; String host = System.getProperty(hostnameKey); String port = System.getProperty(portKey); if (ho...
ServerWebApp extends Server implements ServletContextListener { protected InetSocketAddress resolveAuthority() throws ServerException { String hostnameKey = getName() + HTTP_HOSTNAME; String portKey = getName() + HTTP_PORT; String host = System.getProperty(hostnameKey); String port = System.getProperty(portKey); if (ho...
@Test public void testGetServerAddress() { HServerAddress hsa1 = new HServerAddress("localhost", 1234); HServerInfo hsi1 = new HServerInfo(hsa1, 1L, 5678); assertEquals(hsi1.getServerAddress(), hsa1); }
public synchronized HServerAddress getServerAddress() { return new HServerAddress(serverAddress); }
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public synchronized HServerAddress getServerAddress() { return new HServerAddress(serverAddress); } }
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public synchronized HServerAddress getServerAddress() { return new HServerAddress(serverAddress); } HServerInfo(); HServerInfo(final HServerAddress serverAddress, final int webuiport); HServerInfo(HServerAddress serverAddress, long sta...
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public synchronized HServerAddress getServerAddress() { return new HServerAddress(serverAddress); } HServerInfo(); HServerInfo(final HServerAddress serverAddress, final int webuiport); HServerInfo(HServerAddress serverAddress, long sta...
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public synchronized HServerAddress getServerAddress() { return new HServerAddress(serverAddress); } HServerInfo(); HServerInfo(final HServerAddress serverAddress, final int webuiport); HServerInfo(HServerAddress serverAddress, long sta...
@Test public void testShort() throws Exception { Param<Short> param = new ShortParam("S", (short) 1) { }; test(param, "S", "a short", (short) 1, (short) 2, "x", "" + ((int)Short.MAX_VALUE + 1)); param = new ShortParam("S", (short) 1, 8) { }; assertEquals(new Short((short)01777), param.parse("01777")); }
protected abstract T parse(String str) throws Exception;
Param { protected abstract T parse(String str) throws Exception; }
Param { protected abstract T parse(String str) throws Exception; Param(String name, T defaultValue); }
Param { protected abstract T parse(String str) throws Exception; Param(String name, T defaultValue); String getName(); T parseParam(String str); T value(); String toString(); }
Param { protected abstract T parse(String str) throws Exception; Param(String name, T defaultValue); String getName(); T parseParam(String str); T value(); String toString(); }
@Test public void testToString() { HServerAddress hsa1 = new HServerAddress("localhost", 1234); HServerInfo hsi1 = new HServerInfo(hsa1, 1L, 5678); System.out.println(hsi1.toString()); }
@Override public synchronized String toString() { return ServerName.getServerName(this.serverAddress.getHostnameAndPort(), this.startCode); }
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { @Override public synchronized String toString() { return ServerName.getServerName(this.serverAddress.getHostnameAndPort(), this.startCode); } }
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { @Override public synchronized String toString() { return ServerName.getServerName(this.serverAddress.getHostnameAndPort(), this.startCode); } HServerInfo(); HServerInfo(final HServerAddress serverAddress, final int webuiport); HServerI...
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { @Override public synchronized String toString() { return ServerName.getServerName(this.serverAddress.getHostnameAndPort(), this.startCode); } HServerInfo(); HServerInfo(final HServerAddress serverAddress, final int webuiport); HServerI...
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { @Override public synchronized String toString() { return ServerName.getServerName(this.serverAddress.getHostnameAndPort(), this.startCode); } HServerInfo(); HServerInfo(final HServerAddress serverAddress, final int webuiport); HServerI...
@Test public void testReadFields() throws IOException { HServerAddress hsa1 = new HServerAddress("localhost", 1234); HServerInfo hsi1 = new HServerInfo(hsa1, 1L, 5678); HServerAddress hsa2 = new HServerAddress("localhost", 1235); HServerInfo hsi2 = new HServerInfo(hsa2, 1L, 5678); byte [] bytes = Writables.getBytes(hsi...
public void readFields(DataInput in) throws IOException { super.readFields(in); this.serverAddress.readFields(in); this.startCode = in.readLong(); this.webuiport = in.readInt(); }
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public void readFields(DataInput in) throws IOException { super.readFields(in); this.serverAddress.readFields(in); this.startCode = in.readLong(); this.webuiport = in.readInt(); } }
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public void readFields(DataInput in) throws IOException { super.readFields(in); this.serverAddress.readFields(in); this.startCode = in.readLong(); this.webuiport = in.readInt(); } HServerInfo(); HServerInfo(final HServerAddress serverAd...
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public void readFields(DataInput in) throws IOException { super.readFields(in); this.serverAddress.readFields(in); this.startCode = in.readLong(); this.webuiport = in.readInt(); } HServerInfo(); HServerInfo(final HServerAddress serverAd...
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public void readFields(DataInput in) throws IOException { super.readFields(in); this.serverAddress.readFields(in); this.startCode = in.readLong(); this.webuiport = in.readInt(); } HServerInfo(); HServerInfo(final HServerAddress serverAd...
@Test public void testCompareTo() { HServerAddress hsa1 = new HServerAddress("localhost", 1234); HServerInfo hsi1 = new HServerInfo(hsa1, 1L, 5678); HServerAddress hsa2 = new HServerAddress("localhost", 1235); HServerInfo hsi2 = new HServerInfo(hsa2, 1L, 5678); assertTrue(hsi1.compareTo(hsi1) == 0); assertTrue(hsi2.com...
public int compareTo(HServerInfo o) { int compare = this.serverAddress.compareTo(o.getServerAddress()); if (compare != 0) return compare; if (this.webuiport != o.getInfoPort()) return this.webuiport - o.getInfoPort(); if (this.startCode != o.getStartCode()) return (int)(this.startCode - o.getStartCode()); return 0; }
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public int compareTo(HServerInfo o) { int compare = this.serverAddress.compareTo(o.getServerAddress()); if (compare != 0) return compare; if (this.webuiport != o.getInfoPort()) return this.webuiport - o.getInfoPort(); if (this.startCode ...
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public int compareTo(HServerInfo o) { int compare = this.serverAddress.compareTo(o.getServerAddress()); if (compare != 0) return compare; if (this.webuiport != o.getInfoPort()) return this.webuiport - o.getInfoPort(); if (this.startCode ...
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public int compareTo(HServerInfo o) { int compare = this.serverAddress.compareTo(o.getServerAddress()); if (compare != 0) return compare; if (this.webuiport != o.getInfoPort()) return this.webuiport - o.getInfoPort(); if (this.startCode ...
HServerInfo extends VersionedWritable implements WritableComparable<HServerInfo> { public int compareTo(HServerInfo o) { int compare = this.serverAddress.compareTo(o.getServerAddress()); if (compare != 0) return compare; if (this.webuiport != o.getInfoPort()) return this.webuiport - o.getInfoPort(); if (this.startCode ...
@Test public void testHashCode() { TableSplit split1 = new TableSplit("table".getBytes(), "row-start".getBytes(), "row-end".getBytes(), "location"); TableSplit split2 = new TableSplit("table".getBytes(), "row-start".getBytes(), "row-end".getBytes(), "location"); assertEquals (split1, split2); assertTrue (split1.hashCod...
@Override public int hashCode() { int result = tableName != null ? Arrays.hashCode(tableName) : 0; result = 31 * result + (scan != null ? scan.hashCode() : 0); result = 31 * result + (startRow != null ? Arrays.hashCode(startRow) : 0); result = 31 * result + (endRow != null ? Arrays.hashCode(endRow) : 0); result = 31 * ...
TableSplit extends InputSplit implements Writable, Comparable<TableSplit> { @Override public int hashCode() { int result = tableName != null ? Arrays.hashCode(tableName) : 0; result = 31 * result + (scan != null ? scan.hashCode() : 0); result = 31 * result + (startRow != null ? Arrays.hashCode(startRow) : 0); result = ...
TableSplit extends InputSplit implements Writable, Comparable<TableSplit> { @Override public int hashCode() { int result = tableName != null ? Arrays.hashCode(tableName) : 0; result = 31 * result + (scan != null ? scan.hashCode() : 0); result = 31 * result + (startRow != null ? Arrays.hashCode(startRow) : 0); result = ...
TableSplit extends InputSplit implements Writable, Comparable<TableSplit> { @Override public int hashCode() { int result = tableName != null ? Arrays.hashCode(tableName) : 0; result = 31 * result + (scan != null ? scan.hashCode() : 0); result = 31 * result + (startRow != null ? Arrays.hashCode(startRow) : 0); result = ...
TableSplit extends InputSplit implements Writable, Comparable<TableSplit> { @Override public int hashCode() { int result = tableName != null ? Arrays.hashCode(tableName) : 0; result = 31 * result + (scan != null ? scan.hashCode() : 0); result = 31 * result + (startRow != null ? Arrays.hashCode(startRow) : 0); result = ...
@Test public void testSplitStoreFile() throws IOException { Path dir = util.getDataTestDir("testSplitHFile"); FileSystem fs = util.getTestFileSystem(); Path testIn = new Path(dir, "testhfile"); HColumnDescriptor familyDesc = new HColumnDescriptor(FAMILY); createHFile(util.getConfiguration(), fs, testIn, FAMILY, QUALIFI...
protected List<LoadQueueItem> splitStoreFile(final LoadQueueItem item, final HTable table, byte[] startKey, byte[] splitKey) throws IOException { final Path hfilePath = item.hfilePath; final Path tmpDir = new Path(item.hfilePath.getParent(), "_tmp"); LOG.info("HFile at " + hfilePath + " no longer fits inside a single "...
LoadIncrementalHFiles extends Configured implements Tool { protected List<LoadQueueItem> splitStoreFile(final LoadQueueItem item, final HTable table, byte[] startKey, byte[] splitKey) throws IOException { final Path hfilePath = item.hfilePath; final Path tmpDir = new Path(item.hfilePath.getParent(), "_tmp"); LOG.info("...
LoadIncrementalHFiles extends Configured implements Tool { protected List<LoadQueueItem> splitStoreFile(final LoadQueueItem item, final HTable table, byte[] startKey, byte[] splitKey) throws IOException { final Path hfilePath = item.hfilePath; final Path tmpDir = new Path(item.hfilePath.getParent(), "_tmp"); LOG.info("...
LoadIncrementalHFiles extends Configured implements Tool { protected List<LoadQueueItem> splitStoreFile(final LoadQueueItem item, final HTable table, byte[] startKey, byte[] splitKey) throws IOException { final Path hfilePath = item.hfilePath; final Path tmpDir = new Path(item.hfilePath.getParent(), "_tmp"); LOG.info("...
LoadIncrementalHFiles extends Configured implements Tool { protected List<LoadQueueItem> splitStoreFile(final LoadQueueItem item, final HTable table, byte[] startKey, byte[] splitKey) throws IOException { final Path hfilePath = item.hfilePath; final Path tmpDir = new Path(item.hfilePath.getParent(), "_tmp"); LOG.info("...
@Test public void testInferBoundaries() { TreeMap<byte[], Integer> map = new TreeMap<byte[], Integer>(Bytes.BYTES_COMPARATOR); String first; String last; first = "a"; last = "e"; addStartEndKeysForTest(map, first.getBytes(), last.getBytes()); first = "r"; last = "s"; addStartEndKeysForTest(map, first.getBytes(), last.g...
public static byte[][] inferBoundaries(TreeMap<byte[], Integer> bdryMap) { ArrayList<byte[]> keysArray = new ArrayList<byte[]>(); int runningValue = 0; byte[] currStartKey = null; boolean firstBoundary = true; for (Map.Entry<byte[], Integer> item: bdryMap.entrySet()) { if (runningValue == 0) currStartKey = item.getKey(...
LoadIncrementalHFiles extends Configured implements Tool { public static byte[][] inferBoundaries(TreeMap<byte[], Integer> bdryMap) { ArrayList<byte[]> keysArray = new ArrayList<byte[]>(); int runningValue = 0; byte[] currStartKey = null; boolean firstBoundary = true; for (Map.Entry<byte[], Integer> item: bdryMap.entry...
LoadIncrementalHFiles extends Configured implements Tool { public static byte[][] inferBoundaries(TreeMap<byte[], Integer> bdryMap) { ArrayList<byte[]> keysArray = new ArrayList<byte[]>(); int runningValue = 0; byte[] currStartKey = null; boolean firstBoundary = true; for (Map.Entry<byte[], Integer> item: bdryMap.entry...
LoadIncrementalHFiles extends Configured implements Tool { public static byte[][] inferBoundaries(TreeMap<byte[], Integer> bdryMap) { ArrayList<byte[]> keysArray = new ArrayList<byte[]>(); int runningValue = 0; byte[] currStartKey = null; boolean firstBoundary = true; for (Map.Entry<byte[], Integer> item: bdryMap.entry...
LoadIncrementalHFiles extends Configured implements Tool { public static byte[][] inferBoundaries(TreeMap<byte[], Integer> bdryMap) { ArrayList<byte[]> keysArray = new ArrayList<byte[]>(); int runningValue = 0; byte[] currStartKey = null; boolean firstBoundary = true; for (Map.Entry<byte[], Integer> item: bdryMap.entry...
@Test public void testWALPlayer() throws Exception { final byte[] TABLENAME1 = Bytes.toBytes("testWALPlayer1"); final byte[] TABLENAME2 = Bytes.toBytes("testWALPlayer2"); final byte[] FAMILY = Bytes.toBytes("family"); final byte[] COLUMN1 = Bytes.toBytes("c1"); final byte[] COLUMN2 = Bytes.toBytes("c2"); final byte[] R...
public WALPlayer(Configuration conf) { super(conf); }
WALPlayer extends Configured implements Tool { public WALPlayer(Configuration conf) { super(conf); } }
WALPlayer extends Configured implements Tool { public WALPlayer(Configuration conf) { super(conf); } WALPlayer(Configuration conf); }
WALPlayer extends Configured implements Tool { public WALPlayer(Configuration conf) { super(conf); } WALPlayer(Configuration conf); Job createSubmittableJob(String[] args); static void main(String[] args); @Override int run(String[] args); }
WALPlayer extends Configured implements Tool { public WALPlayer(Configuration conf) { super(conf); } WALPlayer(Configuration conf); Job createSubmittableJob(String[] args); static void main(String[] args); @Override int run(String[] args); }
@Test public void test_LATEST_TIMESTAMP_isReplaced() throws Exception { Configuration conf = new Configuration(this.util.getConfiguration()); RecordWriter<ImmutableBytesWritable, KeyValue> writer = null; TaskAttemptContext context = null; Path dir = util.getDataTestDir("test_LATEST_TIMESTAMP_isReplaced"); try { Job job...
public RecordWriter<ImmutableBytesWritable, KeyValue> getRecordWriter(final TaskAttemptContext context) throws IOException, InterruptedException { final Path outputPath = FileOutputFormat.getOutputPath(context); final Path outputdir = new FileOutputCommitter(outputPath, context).getWorkPath(); final Configuration conf ...
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { public RecordWriter<ImmutableBytesWritable, KeyValue> getRecordWriter(final TaskAttemptContext context) throws IOException, InterruptedException { final Path outputPath = FileOutputFormat.getOutputPath(context); final Path outputdir = new Fi...
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { public RecordWriter<ImmutableBytesWritable, KeyValue> getRecordWriter(final TaskAttemptContext context) throws IOException, InterruptedException { final Path outputPath = FileOutputFormat.getOutputPath(context); final Path outputdir = new Fi...
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { public RecordWriter<ImmutableBytesWritable, KeyValue> getRecordWriter(final TaskAttemptContext context) throws IOException, InterruptedException { final Path outputPath = FileOutputFormat.getOutputPath(context); final Path outputdir = new Fi...
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { public RecordWriter<ImmutableBytesWritable, KeyValue> getRecordWriter(final TaskAttemptContext context) throws IOException, InterruptedException { final Path outputPath = FileOutputFormat.getOutputPath(context); final Path outputdir = new Fi...
@Test public void test_TIMERANGE() throws Exception { Configuration conf = new Configuration(this.util.getConfiguration()); RecordWriter<ImmutableBytesWritable, KeyValue> writer = null; TaskAttemptContext context = null; Path dir = util.getDataTestDir("test_TIMERANGE_present"); LOG.info("Timerange dir writing to dir: "...
public RecordWriter<ImmutableBytesWritable, KeyValue> getRecordWriter(final TaskAttemptContext context) throws IOException, InterruptedException { final Path outputPath = FileOutputFormat.getOutputPath(context); final Path outputdir = new FileOutputCommitter(outputPath, context).getWorkPath(); final Configuration conf ...
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { public RecordWriter<ImmutableBytesWritable, KeyValue> getRecordWriter(final TaskAttemptContext context) throws IOException, InterruptedException { final Path outputPath = FileOutputFormat.getOutputPath(context); final Path outputdir = new Fi...
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { public RecordWriter<ImmutableBytesWritable, KeyValue> getRecordWriter(final TaskAttemptContext context) throws IOException, InterruptedException { final Path outputPath = FileOutputFormat.getOutputPath(context); final Path outputdir = new Fi...
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { public RecordWriter<ImmutableBytesWritable, KeyValue> getRecordWriter(final TaskAttemptContext context) throws IOException, InterruptedException { final Path outputPath = FileOutputFormat.getOutputPath(context); final Path outputdir = new Fi...
HFileOutputFormat extends FileOutputFormat<ImmutableBytesWritable, KeyValue> { public RecordWriter<ImmutableBytesWritable, KeyValue> getRecordWriter(final TaskAttemptContext context) throws IOException, InterruptedException { final Path outputPath = FileOutputFormat.getOutputPath(context); final Path outputdir = new Fi...
@Test public void testCanProcessFilePath() { final EntityHandler<Person> entityHandler = new EntityHandler<Person>( Person.class, false, 0, 0 ); ReaderUtil.process( "src/test/resources/test_people.xlsx", entityHandler.getSheetName(), entityHandler.getEntitySheetHandler() ); List<Person> people = entityHandler.readAsLis...
public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must not be a dire...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
@Test public void testShouldThrowOnDuplicateIndex() { thrown.expect(ZeroCellException.class); thrown.expectMessage("Cannot map two columns to the same index: 0"); Reader.of(DuplicateIndex.class) .from(new File("src/test/resources/test_people.xlsx")) .sheet("uploads") .list(); }
public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
@Test public void testShouldThrowOnIncorrectColumnName() { thrown.expect(ZeroCellException.class); thrown.expectMessage("Expected Column 'DOB' but found 'DATE_OF_BIRTH'"); Reader.of(Person2.class) .from(new File("src/test/resources/test_people.xlsx")) .sheet("uploads") .list(); }
public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
@Test public void testShouldThrowForNonOpenXMLFile() throws IOException { File file = temporaryFolder.newFile(); thrown.expect(ZeroCellException.class); thrown.expectMessage("Cannot load file. The file must be an Excel 2007+ Workbook (.xlsx)"); Reader.of(Person.class) .from(file) .sheet("uploads") .list(); }
public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
@Test public void testCanProcessFile() { final EntityHandler<Person> entityHandler = new EntityHandler<Person>( Person.class, false, 0, 0 ); ReaderUtil.process( new File("src/test/resources/test_people.xlsx"), entityHandler.getSheetName(), entityHandler.getEntitySheetHandler() ); List<Person> people = entityHandler.rea...
public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must not be a dire...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
@Test public void testFailToProcessFirstSheet() { final EntityHandler<Person> entityHandler = new EntityHandler<Person>( Person.class, false, 0, 0 ); try { ReaderUtil.process( new File("src/test/resources/test_people_with_offset_sheet.xlsx"), EntityHandler.DEFAULT_SHEET, entityHandler.getEntitySheetHandler() ); fail("S...
public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must not be a dire...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
@Test public void testCanProcessInputStream() throws IOException { final EntityHandler<Person> entityHandler = new EntityHandler<Person>( Person.class, false, 0, 0 ); ReaderUtil.process( Files.newInputStream( Paths.get("src", "test", "resources", "test_people.xlsx")), entityHandler.getSheetName(), entityHandler.getEnti...
public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must not be a dire...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
ReaderUtil { public static void process(String path, String sheetName, ZeroCellReader reader) { if (path == null || path.trim().isEmpty()) { throw new IllegalArgumentException("'path' must be given"); } File file = new File(path); if (file.exists() && file.isDirectory()) { throw new IllegalArgumentException("path must ...
@Test public void testConvertValuesToString() { assertEquals("Hello", convertValueToType(String.class, "Hello", "A", 1)); assertEquals("HELLO", convertValueToType(String.class, "HELLO", "A", 1)); assertEquals("1.0", convertValueToType(String.class, "1.0", "A", 1)); assertEquals("2019-01-01", convertValueToType(String.c...
public static Object convertValueToType(Class<?> fieldType, String formattedValue, String columnName, int rowNum) { Object value = null; if (fieldType == String.class) { value = String.valueOf(formattedValue); } else if (fieldType == LocalDateTime.class) { return Converters.toLocalDateTime.convert(formattedValue, colum...
ConverterUtils { public static Object convertValueToType(Class<?> fieldType, String formattedValue, String columnName, int rowNum) { Object value = null; if (fieldType == String.class) { value = String.valueOf(formattedValue); } else if (fieldType == LocalDateTime.class) { return Converters.toLocalDateTime.convert(form...
ConverterUtils { public static Object convertValueToType(Class<?> fieldType, String formattedValue, String columnName, int rowNum) { Object value = null; if (fieldType == String.class) { value = String.valueOf(formattedValue); } else if (fieldType == LocalDateTime.class) { return Converters.toLocalDateTime.convert(form...
ConverterUtils { public static Object convertValueToType(Class<?> fieldType, String formattedValue, String columnName, int rowNum) { Object value = null; if (fieldType == String.class) { value = String.valueOf(formattedValue); } else if (fieldType == LocalDateTime.class) { return Converters.toLocalDateTime.convert(form...
ConverterUtils { public static Object convertValueToType(Class<?> fieldType, String formattedValue, String columnName, int rowNum) { Object value = null; if (fieldType == String.class) { value = String.valueOf(formattedValue); } else if (fieldType == LocalDateTime.class) { return Converters.toLocalDateTime.convert(form...
@Test public void testShouldExtractPeopleFromFile() { List<Person> people = Reader.of(Person.class) .from(new File("src/test/resources/test_people.xlsx")) .sheet("uploads") .list(); assertNotNull(people); assertFalse(people.isEmpty()); assertEquals(5, people.size()); Person zikani = people.get(0); assertEquals(1, zikan...
public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
@Test public void testShouldSkipFirst3RowsFromFile() { List<Person> people = Reader.of(Person.class) .from(new File("src/test/resources/test_people_with_offset_header.xlsx")) .sheet("uploads") .skipFirstNRows(3) .list(); assertNotNull(people); assertFalse(people.isEmpty()); assertEquals(5, people.size()); Person zikani...
public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
@Test public void testShouldReadFromInputStream() throws IOException { InputStream inputStream = Files.newInputStream( Paths.get("src", "test", "resources", "test_people.xlsx")); List<Person> persons = Reader.of(Person.class) .from(inputStream) .sheet("uploads") .using( new RowNumberInfo("rowNumber", Integer.class), ne...
public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
@Test public void testShouldExtractColumns() { String[] columnNames = new String[] { "ID", "FIRST_NAME", "MIDDLE_NAME", "LAST_NAME", "DATE_OF_BIRTH", "FAV_NUMBER", "DATE_REGISTERED" }; assertArrayEquals(columnNames, Reader.columnsOf(Person.class)); }
public static <T> String[] columnsOf(Class<T> clazz) { return ColumnInfo.columnsOf(clazz); }
Reader { public static <T> String[] columnsOf(Class<T> clazz) { return ColumnInfo.columnsOf(clazz); } }
Reader { public static <T> String[] columnsOf(Class<T> clazz) { return ColumnInfo.columnsOf(clazz); } }
Reader { public static <T> String[] columnsOf(Class<T> clazz) { return ColumnInfo.columnsOf(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
Reader { public static <T> String[] columnsOf(Class<T> clazz) { return ColumnInfo.columnsOf(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
@Test public void testShouldThrowOnInvalidSheetName() { thrown.expect(ZeroCellException.class); thrown.expectMessage("Could not find sheet INVALID_SHEET_NAME"); Reader.of(Person.class) .from(new File("src/test/resources/test_people.xlsx")) .sheet("INVALID_SHEET_NAME") .list(); }
public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
Reader { public static <T> ReaderBuilder<T> of(Class<T> clazz) { return new ReaderBuilder<>(clazz); } static String[] columnsOf(Class<T> clazz); static ReaderBuilder<T> of(Class<T> clazz); }
@Test public void testBaseLoad() throws Exception { ColorDrawable expected = new ColorDrawable(Color.RED); ListenableFuture<Drawable> future = GlideFutures.submit(Glide.with(app).load(expected)); assertThat(((ColorDrawable) Futures.getDone(future)).getColor()).isEqualTo(expected.getColor()); }
public static <T> ListenableFuture<T> submit(final RequestBuilder<T> requestBuilder) { return transformFromTargetAndResult(submitInternal(requestBuilder)); }
GlideFutures { public static <T> ListenableFuture<T> submit(final RequestBuilder<T> requestBuilder) { return transformFromTargetAndResult(submitInternal(requestBuilder)); } }
GlideFutures { public static <T> ListenableFuture<T> submit(final RequestBuilder<T> requestBuilder) { return transformFromTargetAndResult(submitInternal(requestBuilder)); } private GlideFutures(); }
GlideFutures { public static <T> ListenableFuture<T> submit(final RequestBuilder<T> requestBuilder) { return transformFromTargetAndResult(submitInternal(requestBuilder)); } private GlideFutures(); static ListenableFuture<Void> submitAndExecute( final RequestManager requestManager, RequestBuilder<T> request...
GlideFutures { public static <T> ListenableFuture<T> submit(final RequestBuilder<T> requestBuilder) { return transformFromTargetAndResult(submitInternal(requestBuilder)); } private GlideFutures(); static ListenableFuture<Void> submitAndExecute( final RequestManager requestManager, RequestBuilder<T> request...
@Test public void testRequestComplete_whenCancelledAndUnauthorized_callsCallbackWithNullError() throws Exception { UrlResponseInfo info = getInfo(0, HttpURLConnection.HTTP_FORBIDDEN); fetcher.loadData(Priority.HIGH, callback); Callback urlCallback = urlRequestListenerCaptor.getValue(); urlCallback.onResponseStarted(req...
@Override public void loadData(Priority priority, DataCallback<? super T> callback) { this.callback = callback; serializer.startRequest(priority, url, this); }
ChromiumUrlFetcher implements DataFetcher<T>, ChromiumRequestSerializer.Listener { @Override public void loadData(Priority priority, DataCallback<? super T> callback) { this.callback = callback; serializer.startRequest(priority, url, this); } }
ChromiumUrlFetcher implements DataFetcher<T>, ChromiumRequestSerializer.Listener { @Override public void loadData(Priority priority, DataCallback<? super T> callback) { this.callback = callback; serializer.startRequest(priority, url, this); } ChromiumUrlFetcher( ChromiumRequestSerializer serializer, ByteBufferPar...
ChromiumUrlFetcher implements DataFetcher<T>, ChromiumRequestSerializer.Listener { @Override public void loadData(Priority priority, DataCallback<? super T> callback) { this.callback = callback; serializer.startRequest(priority, url, this); } ChromiumUrlFetcher( ChromiumRequestSerializer serializer, ByteBufferPar...
ChromiumUrlFetcher implements DataFetcher<T>, ChromiumRequestSerializer.Listener { @Override public void loadData(Priority priority, DataCallback<? super T> callback) { this.callback = callback; serializer.startRequest(priority, url, this); } ChromiumUrlFetcher( ChromiumRequestSerializer serializer, ByteBufferPar...
@Test public void testRequestComplete_with200AndCancelled_callsCallbackWithNullException() throws Exception { UrlResponseInfo info = getInfo(0, 200); fetcher.loadData(Priority.LOW, callback); Callback urlCallback = urlRequestListenerCaptor.getValue(); urlCallback.onResponseStarted(request, info); urlCallback.onCanceled...
@Override public void loadData(Priority priority, DataCallback<? super T> callback) { this.callback = callback; serializer.startRequest(priority, url, this); }
ChromiumUrlFetcher implements DataFetcher<T>, ChromiumRequestSerializer.Listener { @Override public void loadData(Priority priority, DataCallback<? super T> callback) { this.callback = callback; serializer.startRequest(priority, url, this); } }
ChromiumUrlFetcher implements DataFetcher<T>, ChromiumRequestSerializer.Listener { @Override public void loadData(Priority priority, DataCallback<? super T> callback) { this.callback = callback; serializer.startRequest(priority, url, this); } ChromiumUrlFetcher( ChromiumRequestSerializer serializer, ByteBufferPar...
ChromiumUrlFetcher implements DataFetcher<T>, ChromiumRequestSerializer.Listener { @Override public void loadData(Priority priority, DataCallback<? super T> callback) { this.callback = callback; serializer.startRequest(priority, url, this); } ChromiumUrlFetcher( ChromiumRequestSerializer serializer, ByteBufferPar...
ChromiumUrlFetcher implements DataFetcher<T>, ChromiumRequestSerializer.Listener { @Override public void loadData(Priority priority, DataCallback<? super T> callback) { this.callback = callback; serializer.startRequest(priority, url, this); } ChromiumUrlFetcher( ChromiumRequestSerializer serializer, ByteBufferPar...
@Test public void testRequestComplete_with200NotCancelledMatchingLength_callsCallbackWithValidData() throws Exception { String data = "data"; ByteBuffer expected = ByteBuffer.wrap(data.getBytes()); ArgumentCaptor<ByteBuffer> captor = ArgumentCaptor.forClass(ByteBuffer.class); fetcher.loadData(Priority.LOW, callback); s...
@Override public void loadData(Priority priority, DataCallback<? super T> callback) { this.callback = callback; serializer.startRequest(priority, url, this); }
ChromiumUrlFetcher implements DataFetcher<T>, ChromiumRequestSerializer.Listener { @Override public void loadData(Priority priority, DataCallback<? super T> callback) { this.callback = callback; serializer.startRequest(priority, url, this); } }
ChromiumUrlFetcher implements DataFetcher<T>, ChromiumRequestSerializer.Listener { @Override public void loadData(Priority priority, DataCallback<? super T> callback) { this.callback = callback; serializer.startRequest(priority, url, this); } ChromiumUrlFetcher( ChromiumRequestSerializer serializer, ByteBufferPar...
ChromiumUrlFetcher implements DataFetcher<T>, ChromiumRequestSerializer.Listener { @Override public void loadData(Priority priority, DataCallback<? super T> callback) { this.callback = callback; serializer.startRequest(priority, url, this); } ChromiumUrlFetcher( ChromiumRequestSerializer serializer, ByteBufferPar...
ChromiumUrlFetcher implements DataFetcher<T>, ChromiumRequestSerializer.Listener { @Override public void loadData(Priority priority, DataCallback<? super T> callback) { this.callback = callback; serializer.startRequest(priority, url, this); } ChromiumUrlFetcher( ChromiumRequestSerializer serializer, ByteBufferPar...
@Test public void testEncodeStrategy_withEncodeTransformationTrue_returnsTransformed() { assertThat(encoder.getEncodeStrategy(options)).isEqualTo(EncodeStrategy.TRANSFORMED); }
@NonNull @Override public EncodeStrategy getEncodeStrategy(@NonNull Options options) { Boolean encodeTransformation = options.get(ENCODE_TRANSFORMATION); return encodeTransformation != null && encodeTransformation ? EncodeStrategy.TRANSFORMED : EncodeStrategy.SOURCE; }
ReEncodingGifResourceEncoder implements ResourceEncoder<GifDrawable> { @NonNull @Override public EncodeStrategy getEncodeStrategy(@NonNull Options options) { Boolean encodeTransformation = options.get(ENCODE_TRANSFORMATION); return encodeTransformation != null && encodeTransformation ? EncodeStrategy.TRANSFORMED : Enco...
ReEncodingGifResourceEncoder implements ResourceEncoder<GifDrawable> { @NonNull @Override public EncodeStrategy getEncodeStrategy(@NonNull Options options) { Boolean encodeTransformation = options.get(ENCODE_TRANSFORMATION); return encodeTransformation != null && encodeTransformation ? EncodeStrategy.TRANSFORMED : Enco...
ReEncodingGifResourceEncoder implements ResourceEncoder<GifDrawable> { @NonNull @Override public EncodeStrategy getEncodeStrategy(@NonNull Options options) { Boolean encodeTransformation = options.get(ENCODE_TRANSFORMATION); return encodeTransformation != null && encodeTransformation ? EncodeStrategy.TRANSFORMED : Enco...
ReEncodingGifResourceEncoder implements ResourceEncoder<GifDrawable> { @NonNull @Override public EncodeStrategy getEncodeStrategy(@NonNull Options options) { Boolean encodeTransformation = options.get(ENCODE_TRANSFORMATION); return encodeTransformation != null && encodeTransformation ? EncodeStrategy.TRANSFORMED : Enco...