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(expected=ProcessingException.class) public void testGetXmxValueIncorrectInput2(){ String jc = " -Xmx1024Q" ; @SuppressWarnings("unused") Long value = JobHistoryFileParserBase.getXmxValue(jc); }
public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.substring(0, valueStr.length() - 1); retVal = Long.parseLong(x...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
@Test public void testGetSubmitTimeMillisFromJobHistory2() throws IOException { String JOB_HISTORY_FILE_NAME = "src/test/resources/job_1329348432655_0001-1329348443227-user-Sleep+job-1329348468601-10-1-SUCCEEDED-default.jhist"; File jobHistoryfile = new File(JOB_HISTORY_FILE_NAME); byte[] contents = Files.toByteArray(j...
public static long getSubmitTimeMillisFromJobHistory(byte[] jobHistoryRaw) { long submitTimeMillis = 0; if (null == jobHistoryRaw) { return submitTimeMillis; } HadoopVersion hv = JobHistoryFileParserFactory.getVersion(jobHistoryRaw); switch (hv) { case TWO: int startIndex = ByteUtil.indexOf(jobHistoryRaw, Constants.JOB...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getSubmitTimeMillisFromJobHistory(byte[] jobHistoryRaw) { long submitTimeMillis = 0; if (null == jobHistoryRaw) { return submitTimeMillis; } HadoopVersion hv = JobHistoryFileParserFactory.getVersion(jobHistoryRaw); switch (hv) { case TWO: int...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getSubmitTimeMillisFromJobHistory(byte[] jobHistoryRaw) { long submitTimeMillis = 0; if (null == jobHistoryRaw) { return submitTimeMillis; } HadoopVersion hv = JobHistoryFileParserFactory.getVersion(jobHistoryRaw); switch (hv) { case TWO: int...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getSubmitTimeMillisFromJobHistory(byte[] jobHistoryRaw) { long submitTimeMillis = 0; if (null == jobHistoryRaw) { return submitTimeMillis; } HadoopVersion hv = JobHistoryFileParserFactory.getVersion(jobHistoryRaw); switch (hv) { case TWO: int...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getSubmitTimeMillisFromJobHistory(byte[] jobHistoryRaw) { long submitTimeMillis = 0; if (null == jobHistoryRaw) { return submitTimeMillis; } HadoopVersion hv = JobHistoryFileParserFactory.getVersion(jobHistoryRaw); switch (hv) { case TWO: int...
@Test(expected=IllegalArgumentException.class) public void testIncorrectSubmitTime() { byte[] jobHistoryBytes = Bytes.toBytes(""); JobHistoryFileParserBase.getSubmitTimeMillisFromJobHistory(jobHistoryBytes); }
public static long getSubmitTimeMillisFromJobHistory(byte[] jobHistoryRaw) { long submitTimeMillis = 0; if (null == jobHistoryRaw) { return submitTimeMillis; } HadoopVersion hv = JobHistoryFileParserFactory.getVersion(jobHistoryRaw); switch (hv) { case TWO: int startIndex = ByteUtil.indexOf(jobHistoryRaw, Constants.JOB...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getSubmitTimeMillisFromJobHistory(byte[] jobHistoryRaw) { long submitTimeMillis = 0; if (null == jobHistoryRaw) { return submitTimeMillis; } HadoopVersion hv = JobHistoryFileParserFactory.getVersion(jobHistoryRaw); switch (hv) { case TWO: int...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getSubmitTimeMillisFromJobHistory(byte[] jobHistoryRaw) { long submitTimeMillis = 0; if (null == jobHistoryRaw) { return submitTimeMillis; } HadoopVersion hv = JobHistoryFileParserFactory.getVersion(jobHistoryRaw); switch (hv) { case TWO: int...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getSubmitTimeMillisFromJobHistory(byte[] jobHistoryRaw) { long submitTimeMillis = 0; if (null == jobHistoryRaw) { return submitTimeMillis; } HadoopVersion hv = JobHistoryFileParserFactory.getVersion(jobHistoryRaw); switch (hv) { case TWO: int...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getSubmitTimeMillisFromJobHistory(byte[] jobHistoryRaw) { long submitTimeMillis = 0; if (null == jobHistoryRaw) { return submitTimeMillis; } HadoopVersion hv = JobHistoryFileParserFactory.getVersion(jobHistoryRaw); switch (hv) { case TWO: int...
@Test public void testCostDefault() { Double jobCost = JobHistoryFileParserBase.calculateJobCost(100L, 0.0, 0L); assertEquals(0.0, jobCost, 0.0001); jobCost = JobHistoryFileParserBase.calculateJobCost(100L, 20.0, 512L); assertEquals(1.413850E-10, jobCost, 0.0001); }
public static double calculateJobCost(long mbMillis, double computeTco, long machineMemory) { if ((machineMemory == 0L) || (computeTco == 0.0)) { LOG.error("Unable to calculate job cost since machineMemory " + machineMemory + " or computeTco " + computeTco + " is 0; returning jobCost as 0"); return 0.0; } double jobCos...
JobHistoryFileParserBase implements JobHistoryFileParser { public static double calculateJobCost(long mbMillis, double computeTco, long machineMemory) { if ((machineMemory == 0L) || (computeTco == 0.0)) { LOG.error("Unable to calculate job cost since machineMemory " + machineMemory + " or computeTco " + computeTco + " ...
JobHistoryFileParserBase implements JobHistoryFileParser { public static double calculateJobCost(long mbMillis, double computeTco, long machineMemory) { if ((machineMemory == 0L) || (computeTco == 0.0)) { LOG.error("Unable to calculate job cost since machineMemory " + machineMemory + " or computeTco " + computeTco + " ...
JobHistoryFileParserBase implements JobHistoryFileParser { public static double calculateJobCost(long mbMillis, double computeTco, long machineMemory) { if ((machineMemory == 0L) || (computeTco == 0.0)) { LOG.error("Unable to calculate job cost since machineMemory " + machineMemory + " or computeTco " + computeTco + " ...
JobHistoryFileParserBase implements JobHistoryFileParser { public static double calculateJobCost(long mbMillis, double computeTco, long machineMemory) { if ((machineMemory == 0L) || (computeTco == 0.0)) { LOG.error("Unable to calculate job cost since machineMemory " + machineMemory + " or computeTco " + computeTco + " ...
@Test public void testPruneFileListBySize() throws IOException { long maxFileSize = 20L; FileStatus[] origList = new FileStatus[2]; FileSystem hdfs = FileSystem.get(UTIL.getConfiguration()); Path inputPath = new Path("/inputdir_filesize"); boolean os = hdfs.mkdirs(inputPath); assertTrue(os); assertTrue(hdfs.exists(inpu...
static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs, Path inputPath) { LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri()); long fileSize = 0L; List<FileStatus> prunedFileList = new ArrayList<FileStatus>(); Set<String> toBeRemovedJobI...
FileLister { static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs, Path inputPath) { LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri()); long fileSize = 0L; List<FileStatus> prunedFileList = new ArrayList<FileStatus>(); Set<String> to...
FileLister { static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs, Path inputPath) { LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri()); long fileSize = 0L; List<FileStatus> prunedFileList = new ArrayList<FileStatus>(); Set<String> to...
FileLister { static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs, Path inputPath) { LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri()); long fileSize = 0L; List<FileStatus> prunedFileList = new ArrayList<FileStatus>(); Set<String> to...
FileLister { static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs, Path inputPath) { LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri()); long fileSize = 0L; List<FileStatus> prunedFileList = new ArrayList<FileStatus>(); Set<String> to...
@Test public void testPruneFileListRemovingConfFromPruneList() throws IOException { long maxFileSize = 20L; FileStatus[] origList = new FileStatus[2]; FileSystem hdfs = FileSystem.get(UTIL.getConfiguration()); Path inputPath = new Path("/inputdir_filesize_pruneList"); boolean os = hdfs.mkdirs(inputPath); assertTrue(os)...
static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs, Path inputPath) { LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri()); long fileSize = 0L; List<FileStatus> prunedFileList = new ArrayList<FileStatus>(); Set<String> toBeRemovedJobI...
FileLister { static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs, Path inputPath) { LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri()); long fileSize = 0L; List<FileStatus> prunedFileList = new ArrayList<FileStatus>(); Set<String> to...
FileLister { static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs, Path inputPath) { LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri()); long fileSize = 0L; List<FileStatus> prunedFileList = new ArrayList<FileStatus>(); Set<String> to...
FileLister { static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs, Path inputPath) { LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri()); long fileSize = 0L; List<FileStatus> prunedFileList = new ArrayList<FileStatus>(); Set<String> to...
FileLister { static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs, Path inputPath) { LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri()); long fileSize = 0L; List<FileStatus> prunedFileList = new ArrayList<FileStatus>(); Set<String> to...
@Test public void testPruneFileListMultipleFilesAlreadyMovedCases() throws IOException { long maxFileSize = 20L; FileStatus[] origList = new FileStatus[12]; FileSystem hdfs = FileSystem.get(UTIL.getConfiguration()); Path inputPath = new Path("/inputdir_filesize_multiple"); boolean os = hdfs.mkdirs(inputPath); assertTru...
static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs, Path inputPath) { LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri()); long fileSize = 0L; List<FileStatus> prunedFileList = new ArrayList<FileStatus>(); Set<String> toBeRemovedJobI...
FileLister { static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs, Path inputPath) { LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri()); long fileSize = 0L; List<FileStatus> prunedFileList = new ArrayList<FileStatus>(); Set<String> to...
FileLister { static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs, Path inputPath) { LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri()); long fileSize = 0L; List<FileStatus> prunedFileList = new ArrayList<FileStatus>(); Set<String> to...
FileLister { static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs, Path inputPath) { LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri()); long fileSize = 0L; List<FileStatus> prunedFileList = new ArrayList<FileStatus>(); Set<String> to...
FileLister { static FileStatus[] pruneFileListBySize(long maxFileSize, FileStatus[] origList, FileSystem hdfs, Path inputPath) { LOG.info("Pruning orig list of size " + origList.length + " for source" + inputPath.toUri()); long fileSize = 0L; List<FileStatus> prunedFileList = new ArrayList<FileStatus>(); Set<String> to...
@Test public void testGetJobIdFromPath() { String JOB_HISTORY_FILE_NAME = "src/test/resources/job_1329348432655_0001-1329348443227-user-Sleep+job-1329348468601-10-1-SUCCEEDED-default.jhist"; File jobHistoryfile = new File(JOB_HISTORY_FILE_NAME); Path srcPath = new Path(jobHistoryfile.toURI()); String jobId = FileLister...
static String getJobIdFromPath(Path aPath) { String fileName = aPath.getName(); JobFile jf = new JobFile(fileName); String jobId = jf.getJobid(); if(jobId == null) { throw new ProcessingException("job id is null for " + aPath.toUri()); } return jobId; }
FileLister { static String getJobIdFromPath(Path aPath) { String fileName = aPath.getName(); JobFile jf = new JobFile(fileName); String jobId = jf.getJobid(); if(jobId == null) { throw new ProcessingException("job id is null for " + aPath.toUri()); } return jobId; } }
FileLister { static String getJobIdFromPath(Path aPath) { String fileName = aPath.getName(); JobFile jf = new JobFile(fileName); String jobId = jf.getJobid(); if(jobId == null) { throw new ProcessingException("job id is null for " + aPath.toUri()); } return jobId; } FileLister(); }
FileLister { static String getJobIdFromPath(Path aPath) { String fileName = aPath.getName(); JobFile jf = new JobFile(fileName); String jobId = jf.getJobid(); if(jobId == null) { throw new ProcessingException("job id is null for " + aPath.toUri()); } return jobId; } FileLister(); static FileStatus[] listFiles(boolean r...
FileLister { static String getJobIdFromPath(Path aPath) { String fileName = aPath.getName(); JobFile jf = new JobFile(fileName); String jobId = jf.getJobid(); if(jobId == null) { throw new ProcessingException("job id is null for " + aPath.toUri()); } return jobId; } FileLister(); static FileStatus[] listFiles(boolean r...
@Test(expected=ProcessingException.class) public void testGetJobIdFromIncorrectPath() { final String JOB_HISTORY_FILE_NAME = "abcd.jhist"; File jobHistoryfile = new File(JOB_HISTORY_FILE_NAME); Path srcPath = new Path(jobHistoryfile.toURI()); FileLister.getJobIdFromPath(srcPath); }
static String getJobIdFromPath(Path aPath) { String fileName = aPath.getName(); JobFile jf = new JobFile(fileName); String jobId = jf.getJobid(); if(jobId == null) { throw new ProcessingException("job id is null for " + aPath.toUri()); } return jobId; }
FileLister { static String getJobIdFromPath(Path aPath) { String fileName = aPath.getName(); JobFile jf = new JobFile(fileName); String jobId = jf.getJobid(); if(jobId == null) { throw new ProcessingException("job id is null for " + aPath.toUri()); } return jobId; } }
FileLister { static String getJobIdFromPath(Path aPath) { String fileName = aPath.getName(); JobFile jf = new JobFile(fileName); String jobId = jf.getJobid(); if(jobId == null) { throw new ProcessingException("job id is null for " + aPath.toUri()); } return jobId; } FileLister(); }
FileLister { static String getJobIdFromPath(Path aPath) { String fileName = aPath.getName(); JobFile jf = new JobFile(fileName); String jobId = jf.getJobid(); if(jobId == null) { throw new ProcessingException("job id is null for " + aPath.toUri()); } return jobId; } FileLister(); static FileStatus[] listFiles(boolean r...
FileLister { static String getJobIdFromPath(Path aPath) { String fileName = aPath.getName(); JobFile jf = new JobFile(fileName); String jobId = jf.getJobid(); if(jobId == null) { throw new ProcessingException("job id is null for " + aPath.toUri()); } return jobId; } FileLister(); static FileStatus[] listFiles(boolean r...
@Test(expected=ProcessingException.class) public void testCreateJobHistoryFileParserNullConf() throws IOException { final String JOB_HISTORY_FILE_NAME = "src/test/resources/job_1329348432655_0001-1329348443227-user-Sleep+job-1329348468601-10-1-SUCCEEDED-default.jhist"; File jobHistoryfile = new File(JOB_HISTORY_FILE_NA...
@Override public void parse(byte[] historyFileContents, JobKey jobKey) throws ProcessingException { this.jobKey = jobKey; this.jobKeyBytes = jobKeyConv.toBytes(jobKey); this.jobDetails = new JobDetails(jobKey); initializeJobDetails(); setJobId(jobKey.getJobId().getJobIdString()); try { FSDataInputStream in = new FSData...
JobHistoryFileParserHadoop2 extends JobHistoryFileParserBase { @Override public void parse(byte[] historyFileContents, JobKey jobKey) throws ProcessingException { this.jobKey = jobKey; this.jobKeyBytes = jobKeyConv.toBytes(jobKey); this.jobDetails = new JobDetails(jobKey); initializeJobDetails(); setJobId(jobKey.getJob...
JobHistoryFileParserHadoop2 extends JobHistoryFileParserBase { @Override public void parse(byte[] historyFileContents, JobKey jobKey) throws ProcessingException { this.jobKey = jobKey; this.jobKeyBytes = jobKeyConv.toBytes(jobKey); this.jobDetails = new JobDetails(jobKey); initializeJobDetails(); setJobId(jobKey.getJob...
JobHistoryFileParserHadoop2 extends JobHistoryFileParserBase { @Override public void parse(byte[] historyFileContents, JobKey jobKey) throws ProcessingException { this.jobKey = jobKey; this.jobKeyBytes = jobKeyConv.toBytes(jobKey); this.jobDetails = new JobDetails(jobKey); initializeJobDetails(); setJobId(jobKey.getJob...
JobHistoryFileParserHadoop2 extends JobHistoryFileParserBase { @Override public void parse(byte[] historyFileContents, JobKey jobKey) throws ProcessingException { this.jobKey = jobKey; this.jobKeyBytes = jobKeyConv.toBytes(jobKey); this.jobDetails = new JobDetails(jobKey); initializeJobDetails(); setJobId(jobKey.getJob...
@Test public void testGetVersion() { String jHist2 = "Avro-Json\n" + "{\"type\":\"record\",\"name\":\"Event\", " + "\"namespace\":\"org.apache.hadoop.mapreduce.jobhistory\",\"fields\":[]\""; HadoopVersion version2 = JobHistoryFileParserFactory.getVersion(jHist2.getBytes()); assertEquals(JobHistoryFileParserFactory.getH...
public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equalsIgnoreCase(version2Part, HADOOP2_VERSION_STRING)) { return HadoopVersion.TWO; } } throw n...
JobHistoryFileParserFactory { public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equalsIgnoreCase(version2Part, HADOOP2_VERSION_STRING)) { return ...
JobHistoryFileParserFactory { public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equalsIgnoreCase(version2Part, HADOOP2_VERSION_STRING)) { return ...
JobHistoryFileParserFactory { public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equalsIgnoreCase(version2Part, HADOOP2_VERSION_STRING)) { return ...
JobHistoryFileParserFactory { public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equalsIgnoreCase(version2Part, HADOOP2_VERSION_STRING)) { return ...
@Test public void testLongExpGetValuesIntBytes() { String[] keysToBeChecked = {"totalMaps", "totalReduces", "finishedMaps", "finishedReduces", "failedMaps", "failedReduces"}; byte[] byteValue = null; int intValue10 = 10; long longValue10 = 10L; JobHistoryFileParserHadoop2 jh = new JobHistoryFileParserHadoop2(null); for...
byte[] getValue(String key, int value) { byte[] valueBytes = null; Class<?> clazz = JobHistoryKeys.KEY_TYPES.get(JobHistoryKeys.valueOf(key)); if (clazz == null) { throw new IllegalArgumentException(" unknown key " + key + " encountered while parsing " + this.jobKey); } if (Long.class.equals(clazz)) { valueBytes = (val...
JobHistoryFileParserHadoop2 extends JobHistoryFileParserBase { byte[] getValue(String key, int value) { byte[] valueBytes = null; Class<?> clazz = JobHistoryKeys.KEY_TYPES.get(JobHistoryKeys.valueOf(key)); if (clazz == null) { throw new IllegalArgumentException(" unknown key " + key + " encountered while parsing " + th...
JobHistoryFileParserHadoop2 extends JobHistoryFileParserBase { byte[] getValue(String key, int value) { byte[] valueBytes = null; Class<?> clazz = JobHistoryKeys.KEY_TYPES.get(JobHistoryKeys.valueOf(key)); if (clazz == null) { throw new IllegalArgumentException(" unknown key " + key + " encountered while parsing " + th...
JobHistoryFileParserHadoop2 extends JobHistoryFileParserBase { byte[] getValue(String key, int value) { byte[] valueBytes = null; Class<?> clazz = JobHistoryKeys.KEY_TYPES.get(JobHistoryKeys.valueOf(key)); if (clazz == null) { throw new IllegalArgumentException(" unknown key " + key + " encountered while parsing " + th...
JobHistoryFileParserHadoop2 extends JobHistoryFileParserBase { byte[] getValue(String key, int value) { byte[] valueBytes = null; Class<?> clazz = JobHistoryKeys.KEY_TYPES.get(JobHistoryKeys.valueOf(key)); if (clazz == null) { throw new IllegalArgumentException(" unknown key " + key + " encountered while parsing " + th...
@Test public void testIntExpGetValuesIntBytes() { String[] keysToBeChecked = {"httpPort"}; byte[] byteValue = null; int intValue10 = 10; JobHistoryFileParserHadoop2 jh = new JobHistoryFileParserHadoop2(null); for(String key: keysToBeChecked) { byteValue = jh.getValue(JobHistoryKeys.HADOOP2_TO_HADOOP1_MAPPING.get(key), ...
byte[] getValue(String key, int value) { byte[] valueBytes = null; Class<?> clazz = JobHistoryKeys.KEY_TYPES.get(JobHistoryKeys.valueOf(key)); if (clazz == null) { throw new IllegalArgumentException(" unknown key " + key + " encountered while parsing " + this.jobKey); } if (Long.class.equals(clazz)) { valueBytes = (val...
JobHistoryFileParserHadoop2 extends JobHistoryFileParserBase { byte[] getValue(String key, int value) { byte[] valueBytes = null; Class<?> clazz = JobHistoryKeys.KEY_TYPES.get(JobHistoryKeys.valueOf(key)); if (clazz == null) { throw new IllegalArgumentException(" unknown key " + key + " encountered while parsing " + th...
JobHistoryFileParserHadoop2 extends JobHistoryFileParserBase { byte[] getValue(String key, int value) { byte[] valueBytes = null; Class<?> clazz = JobHistoryKeys.KEY_TYPES.get(JobHistoryKeys.valueOf(key)); if (clazz == null) { throw new IllegalArgumentException(" unknown key " + key + " encountered while parsing " + th...
JobHistoryFileParserHadoop2 extends JobHistoryFileParserBase { byte[] getValue(String key, int value) { byte[] valueBytes = null; Class<?> clazz = JobHistoryKeys.KEY_TYPES.get(JobHistoryKeys.valueOf(key)); if (clazz == null) { throw new IllegalArgumentException(" unknown key " + key + " encountered while parsing " + th...
JobHistoryFileParserHadoop2 extends JobHistoryFileParserBase { byte[] getValue(String key, int value) { byte[] valueBytes = null; Class<?> clazz = JobHistoryKeys.KEY_TYPES.get(JobHistoryKeys.valueOf(key)); if (clazz == null) { throw new IllegalArgumentException(" unknown key " + key + " encountered while parsing " + th...
@Test public void testIterator() { Counter g1k1 = new Counter("group1", "key1", 10); Counter g1k2 = new Counter("group1", "key2", 20); Counter g2k1 = new Counter("group2", "key1", 100); Counter g3k1 = new Counter("group3", "key1", 200); CounterMap base = new CounterMap(); base.add(g1k1); base.add(g1k2); base.add(g2k1);...
@Override public Iterator<Counter> iterator() { return new Iterator<Counter>() { private Iterator<Map.Entry<String,Map<String,Counter>>> groupIter = internalMap.entrySet().iterator(); private Iterator<Map.Entry<String,Counter>> currentGroupIter = null; @Override public boolean hasNext() { if ((currentGroupIter == null ...
CounterMap implements Iterable<Counter> { @Override public Iterator<Counter> iterator() { return new Iterator<Counter>() { private Iterator<Map.Entry<String,Map<String,Counter>>> groupIter = internalMap.entrySet().iterator(); private Iterator<Map.Entry<String,Counter>> currentGroupIter = null; @Override public boolean ...
CounterMap implements Iterable<Counter> { @Override public Iterator<Counter> iterator() { return new Iterator<Counter>() { private Iterator<Map.Entry<String,Map<String,Counter>>> groupIter = internalMap.entrySet().iterator(); private Iterator<Map.Entry<String,Counter>> currentGroupIter = null; @Override public boolean ...
CounterMap implements Iterable<Counter> { @Override public Iterator<Counter> iterator() { return new Iterator<Counter>() { private Iterator<Map.Entry<String,Map<String,Counter>>> groupIter = internalMap.entrySet().iterator(); private Iterator<Map.Entry<String,Counter>> currentGroupIter = null; @Override public boolean ...
CounterMap implements Iterable<Counter> { @Override public Iterator<Counter> iterator() { return new Iterator<Counter>() { private Iterator<Map.Entry<String,Map<String,Counter>>> groupIter = internalMap.entrySet().iterator(); private Iterator<Map.Entry<String,Counter>> currentGroupIter = null; @Override public boolean ...
@Test public void testCluster() { Cluster.loadHadoopClustersProps("testhRavenClusters.properties"); Configuration c = new Configuration(false); c.set(JobDescFactory.JOBTRACKER_KEY, "cluster1.identifier1.example.com:8021"); String result = JobDescFactory.getCluster(c); assertEquals("cluster1@identifier1", result); c = n...
public static String getCluster(Configuration jobConf) { String jobtracker = jobConf.get(RESOURCE_MANAGER_KEY); if (jobtracker == null) { jobtracker = jobConf.get(JOBTRACKER_KEY); } String cluster = null; if (jobtracker != null) { int portIdx = jobtracker.indexOf(':'); if (portIdx > -1) { jobtracker = jobtracker.substr...
JobDescFactory { public static String getCluster(Configuration jobConf) { String jobtracker = jobConf.get(RESOURCE_MANAGER_KEY); if (jobtracker == null) { jobtracker = jobConf.get(JOBTRACKER_KEY); } String cluster = null; if (jobtracker != null) { int portIdx = jobtracker.indexOf(':'); if (portIdx > -1) { jobtracker = ...
JobDescFactory { public static String getCluster(Configuration jobConf) { String jobtracker = jobConf.get(RESOURCE_MANAGER_KEY); if (jobtracker == null) { jobtracker = jobConf.get(JOBTRACKER_KEY); } String cluster = null; if (jobtracker != null) { int portIdx = jobtracker.indexOf(':'); if (portIdx > -1) { jobtracker = ...
JobDescFactory { public static String getCluster(Configuration jobConf) { String jobtracker = jobConf.get(RESOURCE_MANAGER_KEY); if (jobtracker == null) { jobtracker = jobConf.get(JOBTRACKER_KEY); } String cluster = null; if (jobtracker != null) { int portIdx = jobtracker.indexOf(':'); if (portIdx > -1) { jobtracker = ...
JobDescFactory { public static String getCluster(Configuration jobConf) { String jobtracker = jobConf.get(RESOURCE_MANAGER_KEY); if (jobtracker == null) { jobtracker = jobConf.get(JOBTRACKER_KEY); } String cluster = null; if (jobtracker != null) { int portIdx = jobtracker.indexOf(':'); if (portIdx > -1) { jobtracker = ...
@Test public void testPopulateForHadoop2() { JobDetails jd = new JobDetails(null); NavigableMap<byte[], byte[]> infoValues = getInfoValues(HadoopVersion.TWO); Result result = Mockito.mock(Result.class); when(result.getFamilyMap(Constants.INFO_FAM_BYTES)).thenReturn(infoValues); jd.populate(result); confirmHadoopVersion...
public void populate(Result result) { NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES); this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBID), infoValues); this.user = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKe...
JobDetails implements Comparable<JobDetails> { public void populate(Result result) { NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES); this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBID), infoValues); this.user = ByteUtil.getValueAsString...
JobDetails implements Comparable<JobDetails> { public void populate(Result result) { NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES); this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBID), infoValues); this.user = ByteUtil.getValueAsString...
JobDetails implements Comparable<JobDetails> { public void populate(Result result) { NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES); this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBID), infoValues); this.user = ByteUtil.getValueAsString...
JobDetails implements Comparable<JobDetails> { public void populate(Result result) { NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES); this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBID), infoValues); this.user = ByteUtil.getValueAsString...
@Test public void testGetCounterValueAsLong() { CounterMap cm = new CounterMap(); String cg = Constants.FILESYSTEM_COUNTERS; String cname = Constants.FILES_BYTES_READ; Long expValue = 1234L; Counter c1 = new Counter(cg, cname, expValue); cm.add(c1); JobDetails jd = new JobDetails(null); assertEquals(expValue, jd.getCou...
Long getCounterValueAsLong(final CounterMap counters, final String counterGroupName, final String counterName) { Counter c1 = counters.getCounter(counterGroupName, counterName); if (c1 != null) { return c1.getValue(); } else { return 0L; } }
JobDetails implements Comparable<JobDetails> { Long getCounterValueAsLong(final CounterMap counters, final String counterGroupName, final String counterName) { Counter c1 = counters.getCounter(counterGroupName, counterName); if (c1 != null) { return c1.getValue(); } else { return 0L; } } }
JobDetails implements Comparable<JobDetails> { Long getCounterValueAsLong(final CounterMap counters, final String counterGroupName, final String counterName) { Counter c1 = counters.getCounter(counterGroupName, counterName); if (c1 != null) { return c1.getValue(); } else { return 0L; } } @JsonCreator JobDetails(@JsonP...
JobDetails implements Comparable<JobDetails> { Long getCounterValueAsLong(final CounterMap counters, final String counterGroupName, final String counterName) { Counter c1 = counters.getCounter(counterGroupName, counterName); if (c1 != null) { return c1.getValue(); } else { return 0L; } } @JsonCreator JobDetails(@JsonP...
JobDetails implements Comparable<JobDetails> { Long getCounterValueAsLong(final CounterMap counters, final String counterGroupName, final String counterName) { Counter c1 = counters.getCounter(counterGroupName, counterName); if (c1 != null) { return c1.getValue(); } else { return 0L; } } @JsonCreator JobDetails(@JsonP...
@Test public void testPopulateForHadoop1() { JobDetails jd = new JobDetails(null); NavigableMap<byte[], byte[]> infoValues = getInfoValues(HadoopVersion.ONE); Result result1 = mock(Result.class); when(result1.getFamilyMap(Constants.INFO_FAM_BYTES)).thenReturn(infoValues); jd.populate(result1); confirmHadoopVersion(jd, ...
public void populate(Result result) { NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES); this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBID), infoValues); this.user = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKe...
JobDetails implements Comparable<JobDetails> { public void populate(Result result) { NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES); this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBID), infoValues); this.user = ByteUtil.getValueAsString...
JobDetails implements Comparable<JobDetails> { public void populate(Result result) { NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES); this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBID), infoValues); this.user = ByteUtil.getValueAsString...
JobDetails implements Comparable<JobDetails> { public void populate(Result result) { NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES); this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBID), infoValues); this.user = ByteUtil.getValueAsString...
JobDetails implements Comparable<JobDetails> { public void populate(Result result) { NavigableMap<byte[], byte[]> infoValues = result.getFamilyMap(Constants.INFO_FAM_BYTES); this.jobId = ByteUtil.getValueAsString(JobHistoryKeys.KEYS_TO_BYTES .get(JobHistoryKeys.JOBID), infoValues); this.user = ByteUtil.getValueAsString...
@Test public void testgetAppId() { Configuration conf = new Configuration(); conf.set(Constants.APP_NAME_CONF_KEY, UNSAFE_NAME); assertEquals(SAFE_NAME, getAppId(conf)); }
public String getAppId(Configuration jobConf) { if (jobConf == null) { return Constants.UNKNOWN; } String appId = jobConf.get(Constants.APP_NAME_CONF_KEY); if (StringUtils.isBlank(appId)) { appId = jobConf.get(Constants.JOB_NAME_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJobName(appId); } else ...
JobDescFactoryBase { public String getAppId(Configuration jobConf) { if (jobConf == null) { return Constants.UNKNOWN; } String appId = jobConf.get(Constants.APP_NAME_CONF_KEY); if (StringUtils.isBlank(appId)) { appId = jobConf.get(Constants.JOB_NAME_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJo...
JobDescFactoryBase { public String getAppId(Configuration jobConf) { if (jobConf == null) { return Constants.UNKNOWN; } String appId = jobConf.get(Constants.APP_NAME_CONF_KEY); if (StringUtils.isBlank(appId)) { appId = jobConf.get(Constants.JOB_NAME_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJo...
JobDescFactoryBase { public String getAppId(Configuration jobConf) { if (jobConf == null) { return Constants.UNKNOWN; } String appId = jobConf.get(Constants.APP_NAME_CONF_KEY); if (StringUtils.isBlank(appId)) { appId = jobConf.get(Constants.JOB_NAME_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJo...
JobDescFactoryBase { public String getAppId(Configuration jobConf) { if (jobConf == null) { return Constants.UNKNOWN; } String appId = jobConf.get(Constants.APP_NAME_CONF_KEY); if (StringUtils.isBlank(appId)) { appId = jobConf.get(Constants.JOB_NAME_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJo...
@Test public void testgetAppIdHadoop2() { Configuration conf = new Configuration(); conf.set(Constants.JOB_NAME_CONF_KEY, ""); conf.set(Constants.APP_NAME_CONF_KEY, ""); conf.set(Constants.JOB_NAME_HADOOP2_CONF_KEY, "abc.def.xyz"); assertEquals("abc.def.xyz", getAppId(conf)); }
public String getAppId(Configuration jobConf) { if (jobConf == null) { return Constants.UNKNOWN; } String appId = jobConf.get(Constants.APP_NAME_CONF_KEY); if (StringUtils.isBlank(appId)) { appId = jobConf.get(Constants.JOB_NAME_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJobName(appId); } else ...
JobDescFactoryBase { public String getAppId(Configuration jobConf) { if (jobConf == null) { return Constants.UNKNOWN; } String appId = jobConf.get(Constants.APP_NAME_CONF_KEY); if (StringUtils.isBlank(appId)) { appId = jobConf.get(Constants.JOB_NAME_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJo...
JobDescFactoryBase { public String getAppId(Configuration jobConf) { if (jobConf == null) { return Constants.UNKNOWN; } String appId = jobConf.get(Constants.APP_NAME_CONF_KEY); if (StringUtils.isBlank(appId)) { appId = jobConf.get(Constants.JOB_NAME_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJo...
JobDescFactoryBase { public String getAppId(Configuration jobConf) { if (jobConf == null) { return Constants.UNKNOWN; } String appId = jobConf.get(Constants.APP_NAME_CONF_KEY); if (StringUtils.isBlank(appId)) { appId = jobConf.get(Constants.JOB_NAME_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJo...
JobDescFactoryBase { public String getAppId(Configuration jobConf) { if (jobConf == null) { return Constants.UNKNOWN; } String appId = jobConf.get(Constants.APP_NAME_CONF_KEY); if (StringUtils.isBlank(appId)) { appId = jobConf.get(Constants.JOB_NAME_CONF_KEY); if (StringUtils.isNotBlank(appId)) { appId = getAppIdFromJo...
@Test public void testSerialization() { TaskKeyConverter conv = new TaskKeyConverter(); TaskKey key1 = new TaskKey( new JobKey("test@local", "testuser", "app", 1234L, "job_20120101000000_1111"), "m_001"); assertEquals("test@local", key1.getCluster()); assertEquals("testuser", key1.getUserName()); assertEquals("app", ke...
public String getTaskId() { return this.taskId; }
TaskKey extends JobKey implements Comparable<Object> { public String getTaskId() { return this.taskId; } }
TaskKey extends JobKey implements Comparable<Object> { public String getTaskId() { return this.taskId; } @JsonCreator TaskKey(@JsonProperty("jobId") JobKey jobKey, @JsonProperty("taskId") String taskId); }
TaskKey extends JobKey implements Comparable<Object> { public String getTaskId() { return this.taskId; } @JsonCreator TaskKey(@JsonProperty("jobId") JobKey jobKey, @JsonProperty("taskId") String taskId); String getTaskId(); String toString(); @Override int compareTo(Object other); @Override boolean equals(Object other...
TaskKey extends JobKey implements Comparable<Object> { public String getTaskId() { return this.taskId; } @JsonCreator TaskKey(@JsonProperty("jobId") JobKey jobKey, @JsonProperty("taskId") String taskId); String getTaskId(); String toString(); @Override int compareTo(Object other); @Override boolean equals(Object other...
@Test(expected = IllegalArgumentException.class) public void testGetVersionIncorrect2() { String jHist2 = "Avro-HELLO-Json\n" + "{\"type\":\"record\",\"name\":\"Event\", " + "\"namespace\":\"org.apache.hadoop.mapreduce.jobhistory\",\"fields\":[]\""; JobHistoryFileParserFactory.getVersion(jHist2.getBytes()); }
public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equalsIgnoreCase(version2Part, HADOOP2_VERSION_STRING)) { return HadoopVersion.TWO; } } throw n...
JobHistoryFileParserFactory { public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equalsIgnoreCase(version2Part, HADOOP2_VERSION_STRING)) { return ...
JobHistoryFileParserFactory { public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equalsIgnoreCase(version2Part, HADOOP2_VERSION_STRING)) { return ...
JobHistoryFileParserFactory { public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equalsIgnoreCase(version2Part, HADOOP2_VERSION_STRING)) { return ...
JobHistoryFileParserFactory { public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equalsIgnoreCase(version2Part, HADOOP2_VERSION_STRING)) { return ...
@Test public void testToString() { JobKey jKey = new JobKey("test@local", "testuser", "app", 1234L, "job_20120101000000_1111"); TaskKey key = new TaskKey(jKey, "m_001"); String expected = jKey.toString() + Constants.SEP + "m_001"; assertEquals(expected, key.toString()); }
public String toString() { return super.toString() + Constants.SEP + getTaskId(); }
TaskKey extends JobKey implements Comparable<Object> { public String toString() { return super.toString() + Constants.SEP + getTaskId(); } }
TaskKey extends JobKey implements Comparable<Object> { public String toString() { return super.toString() + Constants.SEP + getTaskId(); } @JsonCreator TaskKey(@JsonProperty("jobId") JobKey jobKey, @JsonProperty("taskId") String taskId); }
TaskKey extends JobKey implements Comparable<Object> { public String toString() { return super.toString() + Constants.SEP + getTaskId(); } @JsonCreator TaskKey(@JsonProperty("jobId") JobKey jobKey, @JsonProperty("taskId") String taskId); String getTaskId(); String toString(); @Override int compareTo(Object other); @Ov...
TaskKey extends JobKey implements Comparable<Object> { public String toString() { return super.toString() + Constants.SEP + getTaskId(); } @JsonCreator TaskKey(@JsonProperty("jobId") JobKey jobKey, @JsonProperty("taskId") String taskId); String getTaskId(); String toString(); @Override int compareTo(Object other); @Ov...
@Test public void testGetPos() throws IOException { ByteArrayWrapper wrapper = createInstance(16); final int length = 4; byte[] buf = new byte[length]; wrapper.read(buf); assertEquals(length, wrapper.getPos()); wrapper.close(); }
public synchronized long getPos() throws IOException { return pos; }
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized long getPos() throws IOException { return pos; } }
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized long getPos() throws IOException { return pos; } ByteArrayWrapper(byte[] buf); }
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized long getPos() throws IOException { return pos; } ByteArrayWrapper(byte[] buf); synchronized void seek(long position); synchronized long getPos(); boolean seekToNewSource(long targetPos); synchronized i...
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized long getPos() throws IOException { return pos; } ByteArrayWrapper(byte[] buf); synchronized void seek(long position); synchronized long getPos(); boolean seekToNewSource(long targetPos); synchronized i...
@Test public void testSeek() throws IOException { ByteArrayWrapper wrapper = createInstance(16); final int position = 4; wrapper.seek(position); assertEquals(4, wrapper.getPos()); wrapper.close(); }
public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; }
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; } }
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; } B...
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; } B...
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; } B...
@Test(expected=IOException.class) public void testSeekNegative() throws IOException { ByteArrayWrapper wrapper = createInstance(16); wrapper.seek(-2); wrapper.close(); }
public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; }
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; } }
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; } B...
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; } B...
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; } B...
@Test(expected=IOException.class) public void testSeekOutOfBounds() throws IOException { ByteArrayWrapper wrapper = createInstance(16); wrapper.seek(20); wrapper.close(); }
public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; }
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; } }
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; } B...
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; } B...
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void seek(long position) throws IOException { if (position < 0 || position >= count) { throw new IOException("cannot seek position " + position + " as it is out of bounds"); } pos = (int) position; } B...
@Test public void testSeekToNewSource() throws IOException { ByteArrayWrapper wrapper = createInstance(16); assertFalse(wrapper.seekToNewSource(1234)); wrapper.close(); }
public boolean seekToNewSource(long targetPos) throws IOException { return false; }
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public boolean seekToNewSource(long targetPos) throws IOException { return false; } }
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public boolean seekToNewSource(long targetPos) throws IOException { return false; } ByteArrayWrapper(byte[] buf); }
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public boolean seekToNewSource(long targetPos) throws IOException { return false; } ByteArrayWrapper(byte[] buf); synchronized void seek(long position); synchronized long getPos(); boolean seekToNewSource(long targetPos);...
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public boolean seekToNewSource(long targetPos) throws IOException { return false; } ByteArrayWrapper(byte[] buf); synchronized void seek(long position); synchronized long getPos(); boolean seekToNewSource(long targetPos);...
@Test public void testRead() throws IOException { byte[] array = createByteArray(16); ByteArrayWrapper wrapper = new ByteArrayWrapper(array); final long oldPosition = wrapper.getPos(); final long newPosition = 3; final int length = 4; byte[] buffer = new byte[length]; int read = wrapper.read(newPosition, buffer, 0, len...
public synchronized int read(long position, byte[] buffer, int offset, int length) throws IOException { long oldPos = getPos(); int nread = -1; try { seek(position); nread = read(buffer, offset, length); } finally { seek(oldPos); } return nread; }
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized int read(long position, byte[] buffer, int offset, int length) throws IOException { long oldPos = getPos(); int nread = -1; try { seek(position); nread = read(buffer, offset, length); } finally { seek(...
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized int read(long position, byte[] buffer, int offset, int length) throws IOException { long oldPos = getPos(); int nread = -1; try { seek(position); nread = read(buffer, offset, length); } finally { seek(...
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized int read(long position, byte[] buffer, int offset, int length) throws IOException { long oldPos = getPos(); int nread = -1; try { seek(position); nread = read(buffer, offset, length); } finally { seek(...
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized int read(long position, byte[] buffer, int offset, int length) throws IOException { long oldPos = getPos(); int nread = -1; try { seek(position); nread = read(buffer, offset, length); } finally { seek(...
@Test public void testReadFully() throws IOException { byte[] array = createByteArray(16); ByteArrayWrapper wrapper = new ByteArrayWrapper(array); final long oldPosition = wrapper.getPos(); final long newPosition = 3; final int length = 13; byte[] buffer = new byte[length]; wrapper.readFully(newPosition, buffer); compa...
public synchronized void readFully(long position, byte[] buffer, int offset, int length) throws IOException { int nread = 0; while (nread < length) { int nbytes = read(position + nread, buffer, offset + nread, length - nread); if (nbytes < 0) { throw new EOFException("End of file reached before reading fully."); } nrea...
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void readFully(long position, byte[] buffer, int offset, int length) throws IOException { int nread = 0; while (nread < length) { int nbytes = read(position + nread, buffer, offset + nread, length - nr...
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void readFully(long position, byte[] buffer, int offset, int length) throws IOException { int nread = 0; while (nread < length) { int nbytes = read(position + nread, buffer, offset + nread, length - nr...
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void readFully(long position, byte[] buffer, int offset, int length) throws IOException { int nread = 0; while (nread < length) { int nbytes = read(position + nread, buffer, offset + nread, length - nr...
ByteArrayWrapper extends ByteArrayInputStream implements PositionedReadable, Seekable, Closeable { public synchronized void readFully(long position, byte[] buffer, int offset, int length) throws IOException { int nread = 0; while (nread < length) { int nbytes = read(position + nread, buffer, offset + nread, length - nr...
@Test public void testContains() throws FileNotFoundException { final String JOB_CONF_FILE_NAME = "src/test/resources/job_1329348432655_0001_conf.xml"; Configuration jobConf = new Configuration(); jobConf.addResource(new FileInputStream(JOB_CONF_FILE_NAME)); assertTrue(HadoopConfUtil.contains(jobConf, Constants.USER_CO...
public static boolean contains(Configuration jobConf, String name) { if (StringUtils.isNotBlank(jobConf.get(name))) { return true; } else { return false; } }
HadoopConfUtil { public static boolean contains(Configuration jobConf, String name) { if (StringUtils.isNotBlank(jobConf.get(name))) { return true; } else { return false; } } }
HadoopConfUtil { public static boolean contains(Configuration jobConf, String name) { if (StringUtils.isNotBlank(jobConf.get(name))) { return true; } else { return false; } } }
HadoopConfUtil { public static boolean contains(Configuration jobConf, String name) { if (StringUtils.isNotBlank(jobConf.get(name))) { return true; } else { return false; } } static String getUserNameInConf(Configuration jobConf); static boolean contains(Configuration jobConf, String name); static String getQueueName(...
HadoopConfUtil { public static boolean contains(Configuration jobConf, String name) { if (StringUtils.isNotBlank(jobConf.get(name))) { return true; } else { return false; } } static String getUserNameInConf(Configuration jobConf); static boolean contains(Configuration jobConf, String name); static String getQueueName(...
@Test public void testGetUserNameInConf() throws FileNotFoundException { final String JOB_CONF_FILE_NAME = "src/test/resources/job_1329348432655_0001_conf.xml"; Configuration jobConf = new Configuration(); jobConf.addResource(new FileInputStream(JOB_CONF_FILE_NAME)); String userName = HadoopConfUtil.getUserNameInConf(j...
public static String getUserNameInConf(Configuration jobConf) throws IllegalArgumentException { String userName = jobConf.get(Constants.USER_CONF_KEY_HADOOP2); if (StringUtils.isBlank(userName)) { userName = jobConf.get(Constants.USER_CONF_KEY); if (StringUtils.isBlank(userName)) { throw new IllegalArgumentException(" ...
HadoopConfUtil { public static String getUserNameInConf(Configuration jobConf) throws IllegalArgumentException { String userName = jobConf.get(Constants.USER_CONF_KEY_HADOOP2); if (StringUtils.isBlank(userName)) { userName = jobConf.get(Constants.USER_CONF_KEY); if (StringUtils.isBlank(userName)) { throw new IllegalArg...
HadoopConfUtil { public static String getUserNameInConf(Configuration jobConf) throws IllegalArgumentException { String userName = jobConf.get(Constants.USER_CONF_KEY_HADOOP2); if (StringUtils.isBlank(userName)) { userName = jobConf.get(Constants.USER_CONF_KEY); if (StringUtils.isBlank(userName)) { throw new IllegalArg...
HadoopConfUtil { public static String getUserNameInConf(Configuration jobConf) throws IllegalArgumentException { String userName = jobConf.get(Constants.USER_CONF_KEY_HADOOP2); if (StringUtils.isBlank(userName)) { userName = jobConf.get(Constants.USER_CONF_KEY); if (StringUtils.isBlank(userName)) { throw new IllegalArg...
HadoopConfUtil { public static String getUserNameInConf(Configuration jobConf) throws IllegalArgumentException { String userName = jobConf.get(Constants.USER_CONF_KEY_HADOOP2); if (StringUtils.isBlank(userName)) { userName = jobConf.get(Constants.USER_CONF_KEY); if (StringUtils.isBlank(userName)) { throw new IllegalArg...
@Test(expected = IllegalArgumentException.class) public void testGetVersionIncorrect1() { String jHist1 = "Meta HELLO VERSION=\"1\" .\n" + "Job JOBID=\"job_201301010000_12345\""; JobHistoryFileParserFactory.getVersion(jHist1.getBytes()); }
public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equalsIgnoreCase(version2Part, HADOOP2_VERSION_STRING)) { return HadoopVersion.TWO; } } throw n...
JobHistoryFileParserFactory { public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equalsIgnoreCase(version2Part, HADOOP2_VERSION_STRING)) { return ...
JobHistoryFileParserFactory { public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equalsIgnoreCase(version2Part, HADOOP2_VERSION_STRING)) { return ...
JobHistoryFileParserFactory { public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equalsIgnoreCase(version2Part, HADOOP2_VERSION_STRING)) { return ...
JobHistoryFileParserFactory { public static HadoopVersion getVersion(byte[] historyFileContents) { if(historyFileContents.length > HADOOP2_VERSION_LENGTH) { String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH); if (StringUtils.equalsIgnoreCase(version2Part, HADOOP2_VERSION_STRING)) { return ...
@Test public void testGetQueueName() throws FileNotFoundException { final String JOB_CONF_FILE_NAME = "src/test/resources/job_1329348432655_0001_conf.xml"; Configuration jobConf = new Configuration(); jobConf.addResource(new FileInputStream(JOB_CONF_FILE_NAME)); String queueName = HadoopConfUtil.getQueueName(jobConf); ...
public static String getQueueName(Configuration jobConf) { String hRavenQueueName = jobConf.get(Constants.QUEUENAME_HADOOP2); if (StringUtils.isBlank(hRavenQueueName)) { hRavenQueueName = jobConf .get(Constants.FAIR_SCHEDULER_POOLNAME_HADOOP1); if (StringUtils.isBlank(hRavenQueueName)) { hRavenQueueName = jobConf .get(...
HadoopConfUtil { public static String getQueueName(Configuration jobConf) { String hRavenQueueName = jobConf.get(Constants.QUEUENAME_HADOOP2); if (StringUtils.isBlank(hRavenQueueName)) { hRavenQueueName = jobConf .get(Constants.FAIR_SCHEDULER_POOLNAME_HADOOP1); if (StringUtils.isBlank(hRavenQueueName)) { hRavenQueueNam...
HadoopConfUtil { public static String getQueueName(Configuration jobConf) { String hRavenQueueName = jobConf.get(Constants.QUEUENAME_HADOOP2); if (StringUtils.isBlank(hRavenQueueName)) { hRavenQueueName = jobConf .get(Constants.FAIR_SCHEDULER_POOLNAME_HADOOP1); if (StringUtils.isBlank(hRavenQueueName)) { hRavenQueueNam...
HadoopConfUtil { public static String getQueueName(Configuration jobConf) { String hRavenQueueName = jobConf.get(Constants.QUEUENAME_HADOOP2); if (StringUtils.isBlank(hRavenQueueName)) { hRavenQueueName = jobConf .get(Constants.FAIR_SCHEDULER_POOLNAME_HADOOP1); if (StringUtils.isBlank(hRavenQueueName)) { hRavenQueueNam...
HadoopConfUtil { public static String getQueueName(Configuration jobConf) { String hRavenQueueName = jobConf.get(Constants.QUEUENAME_HADOOP2); if (StringUtils.isBlank(hRavenQueueName)) { hRavenQueueName = jobConf .get(Constants.FAIR_SCHEDULER_POOLNAME_HADOOP1); if (StringUtils.isBlank(hRavenQueueName)) { hRavenQueueNam...
@Test(expected=IllegalArgumentException.class) public void checkUserNameAlwaysSet() throws FileNotFoundException { final String JOB_CONF_FILE_NAME = "src/test/resources/job_1329348432655_0001_conf.xml"; Configuration jobConf = new Configuration(); jobConf.addResource(new FileInputStream(JOB_CONF_FILE_NAME)); jobConf.se...
public static String getUserNameInConf(Configuration jobConf) throws IllegalArgumentException { String userName = jobConf.get(Constants.USER_CONF_KEY_HADOOP2); if (StringUtils.isBlank(userName)) { userName = jobConf.get(Constants.USER_CONF_KEY); if (StringUtils.isBlank(userName)) { throw new IllegalArgumentException(" ...
HadoopConfUtil { public static String getUserNameInConf(Configuration jobConf) throws IllegalArgumentException { String userName = jobConf.get(Constants.USER_CONF_KEY_HADOOP2); if (StringUtils.isBlank(userName)) { userName = jobConf.get(Constants.USER_CONF_KEY); if (StringUtils.isBlank(userName)) { throw new IllegalArg...
HadoopConfUtil { public static String getUserNameInConf(Configuration jobConf) throws IllegalArgumentException { String userName = jobConf.get(Constants.USER_CONF_KEY_HADOOP2); if (StringUtils.isBlank(userName)) { userName = jobConf.get(Constants.USER_CONF_KEY); if (StringUtils.isBlank(userName)) { throw new IllegalArg...
HadoopConfUtil { public static String getUserNameInConf(Configuration jobConf) throws IllegalArgumentException { String userName = jobConf.get(Constants.USER_CONF_KEY_HADOOP2); if (StringUtils.isBlank(userName)) { userName = jobConf.get(Constants.USER_CONF_KEY); if (StringUtils.isBlank(userName)) { throw new IllegalArg...
HadoopConfUtil { public static String getUserNameInConf(Configuration jobConf) throws IllegalArgumentException { String userName = jobConf.get(Constants.USER_CONF_KEY_HADOOP2); if (StringUtils.isBlank(userName)) { userName = jobConf.get(Constants.USER_CONF_KEY); if (StringUtils.isBlank(userName)) { throw new IllegalArg...
@Test public void testSplit() { byte[][] expected1 = Bytes .toByteArrays(new String[] { "abc", "bcd", "cde" }); byte[][] splitresult = ByteUtil.split(source1, sep1); assertSplitResult(expected1, splitresult); byte[][] expected2 = Bytes.toByteArrays(new String[] { "random", "stuff", "" }); splitresult = ByteUtil.split(s...
public static byte[][] split(byte[] source, byte[] separator) { return split(source, separator, -1); }
ByteUtil { public static byte[][] split(byte[] source, byte[] separator) { return split(source, separator, -1); } }
ByteUtil { public static byte[][] split(byte[] source, byte[] separator) { return split(source, separator, -1); } }
ByteUtil { public static byte[][] split(byte[] source, byte[] separator) { return split(source, separator, -1); } static byte[][] split(byte[] source, byte[] separator); static byte[][] split(byte[] source, byte[] separator, int limit); static List<Range> splitRanges(byte[] source, byte[] separator); static List<Range...
ByteUtil { public static byte[][] split(byte[] source, byte[] separator) { return split(source, separator, -1); } static byte[][] split(byte[] source, byte[] separator); static byte[][] split(byte[] source, byte[] separator, int limit); static List<Range> splitRanges(byte[] source, byte[] separator); static List<Range...
@Test public void testSplitWithLimit() { byte[][] expectedResult = Bytes.toByteArrays(new String[] {"random", "stuff::"}); byte[][] splitResult = ByteUtil.split(source2, sep2, 2); assertSplitResult(expectedResult, splitResult); expectedResult = Bytes.toByteArrays(new String[] {"random", "stuff", ""}); splitResult = Byt...
public static byte[][] split(byte[] source, byte[] separator) { return split(source, separator, -1); }
ByteUtil { public static byte[][] split(byte[] source, byte[] separator) { return split(source, separator, -1); } }
ByteUtil { public static byte[][] split(byte[] source, byte[] separator) { return split(source, separator, -1); } }
ByteUtil { public static byte[][] split(byte[] source, byte[] separator) { return split(source, separator, -1); } static byte[][] split(byte[] source, byte[] separator); static byte[][] split(byte[] source, byte[] separator, int limit); static List<Range> splitRanges(byte[] source, byte[] separator); static List<Range...
ByteUtil { public static byte[][] split(byte[] source, byte[] separator) { return split(source, separator, -1); } static byte[][] split(byte[] source, byte[] separator); static byte[][] split(byte[] source, byte[] separator, int limit); static List<Range> splitRanges(byte[] source, byte[] separator); static List<Range...
@Test public void testSplitRanges() { try { new ByteUtil.Range(-1, 1); fail("Should have failed with start < 0"); } catch (IllegalArgumentException expected) { } try { new ByteUtil.Range(2, 1); fail("Should have failed with end < start"); } catch (IllegalArgumentException expected) { } List<ByteUtil.Range> ranges1 = By...
public static List<Range> splitRanges(byte[] source, byte[] separator) { return splitRanges(source, separator, -1); }
ByteUtil { public static List<Range> splitRanges(byte[] source, byte[] separator) { return splitRanges(source, separator, -1); } }
ByteUtil { public static List<Range> splitRanges(byte[] source, byte[] separator) { return splitRanges(source, separator, -1); } }
ByteUtil { public static List<Range> splitRanges(byte[] source, byte[] separator) { return splitRanges(source, separator, -1); } static byte[][] split(byte[] source, byte[] separator); static byte[][] split(byte[] source, byte[] separator, int limit); static List<Range> splitRanges(byte[] source, byte[] separator); st...
ByteUtil { public static List<Range> splitRanges(byte[] source, byte[] separator) { return splitRanges(source, separator, -1); } static byte[][] split(byte[] source, byte[] separator); static byte[][] split(byte[] source, byte[] separator, int limit); static List<Range> splitRanges(byte[] source, byte[] separator); st...
@Test public void testJoin() { byte[] comp1 = Bytes.toBytes("abc"); byte[] comp2 = Bytes.toBytes("def"); byte[] comp3 = Bytes.toBytes("ghi"); byte[] joined = ByteUtil.join(Constants.SEP_BYTES); assertNotNull(joined); assertEquals(0, joined.length); joined = ByteUtil.join(null, comp1, comp2, comp3); assertNotNull(joined...
public static byte[] join(byte[] separator, byte[]... components) { if (components == null || components.length == 0) { return Constants.EMPTY_BYTES; } int finalSize = 0; if (separator != null) { finalSize = separator.length * (components.length - 1); } for (byte[] comp : components) { finalSize += comp.length; } byte[...
ByteUtil { public static byte[] join(byte[] separator, byte[]... components) { if (components == null || components.length == 0) { return Constants.EMPTY_BYTES; } int finalSize = 0; if (separator != null) { finalSize = separator.length * (components.length - 1); } for (byte[] comp : components) { finalSize += comp.leng...
ByteUtil { public static byte[] join(byte[] separator, byte[]... components) { if (components == null || components.length == 0) { return Constants.EMPTY_BYTES; } int finalSize = 0; if (separator != null) { finalSize = separator.length * (components.length - 1); } for (byte[] comp : components) { finalSize += comp.leng...
ByteUtil { public static byte[] join(byte[] separator, byte[]... components) { if (components == null || components.length == 0) { return Constants.EMPTY_BYTES; } int finalSize = 0; if (separator != null) { finalSize = separator.length * (components.length - 1); } for (byte[] comp : components) { finalSize += comp.leng...
ByteUtil { public static byte[] join(byte[] separator, byte[]... components) { if (components == null || components.length == 0) { return Constants.EMPTY_BYTES; } int finalSize = 0; if (separator != null) { finalSize = separator.length * (components.length - 1); } for (byte[] comp : components) { finalSize += comp.leng...
@Test public void testIndexOf() { byte[] array = Bytes.toBytes("quackattack"); byte[] a = Bytes.toBytes("a"); byte[] ack = Bytes.toBytes("ack"); byte[] empty = Bytes.toBytes(""); int index = ByteUtil.indexOf(array, null, 0); assertEquals(-1, index); index = ByteUtil.indexOf(null, ack, 0); assertEquals(-1, index); index...
public static int indexOf(byte[] array, byte[] target, int fromIndex) { if (array == null || target == null) { return -1; } if (fromIndex < 0 || (fromIndex > (array.length - target.length))) { return -1; } if (target.length == 0) { return fromIndex; } firstbyte: for (int i = fromIndex; i < array.length - target.length ...
ByteUtil { public static int indexOf(byte[] array, byte[] target, int fromIndex) { if (array == null || target == null) { return -1; } if (fromIndex < 0 || (fromIndex > (array.length - target.length))) { return -1; } if (target.length == 0) { return fromIndex; } firstbyte: for (int i = fromIndex; i < array.length - tar...
ByteUtil { public static int indexOf(byte[] array, byte[] target, int fromIndex) { if (array == null || target == null) { return -1; } if (fromIndex < 0 || (fromIndex > (array.length - target.length))) { return -1; } if (target.length == 0) { return fromIndex; } firstbyte: for (int i = fromIndex; i < array.length - tar...
ByteUtil { public static int indexOf(byte[] array, byte[] target, int fromIndex) { if (array == null || target == null) { return -1; } if (fromIndex < 0 || (fromIndex > (array.length - target.length))) { return -1; } if (target.length == 0) { return fromIndex; } firstbyte: for (int i = fromIndex; i < array.length - tar...
ByteUtil { public static int indexOf(byte[] array, byte[] target, int fromIndex) { if (array == null || target == null) { return -1; } if (fromIndex < 0 || (fromIndex > (array.length - target.length))) { return -1; } if (target.length == 0) { return fromIndex; } firstbyte: for (int i = fromIndex; i < array.length - tar...
@Test public void testGetValueAsLong() { NavigableMap<byte[], byte[]> infoValues = new TreeMap<byte[], byte[]>(Bytes.BYTES_COMPARATOR); infoValues.put(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.TOTAL_MAPS), Bytes.toBytes(JobDetailsValues.totalMaps)); long expVal = JobDetailsValues.totalMaps; assertEquals(expVal, B...
public static long getValueAsLong(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { try { long retValue = Bytes.toLong(value); return retValue; } catch (NumberFormatException nfe) { LOG.error("Caught NFE while converting to long ", nfe); return 0L; } catc...
ByteUtil { public static long getValueAsLong(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { try { long retValue = Bytes.toLong(value); return retValue; } catch (NumberFormatException nfe) { LOG.error("Caught NFE while converting to long ", nfe); return...
ByteUtil { public static long getValueAsLong(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { try { long retValue = Bytes.toLong(value); return retValue; } catch (NumberFormatException nfe) { LOG.error("Caught NFE while converting to long ", nfe); return...
ByteUtil { public static long getValueAsLong(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { try { long retValue = Bytes.toLong(value); return retValue; } catch (NumberFormatException nfe) { LOG.error("Caught NFE while converting to long ", nfe); return...
ByteUtil { public static long getValueAsLong(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { try { long retValue = Bytes.toLong(value); return retValue; } catch (NumberFormatException nfe) { LOG.error("Caught NFE while converting to long ", nfe); return...
@Test public void testGetValueAsString() { NavigableMap<byte[], byte[]> infoValues = new TreeMap<byte[], byte[]>(Bytes.BYTES_COMPARATOR); infoValues.put(JobHistoryKeys.KEYS_TO_BYTES.get(JobHistoryKeys.JOBNAME), Bytes.toBytes(JobDetailsValues.jobName)); assertEquals(JobDetailsValues.jobName, ByteUtil.getValueAsString( J...
public static String getValueAsString(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { return Bytes.toString(value); } else { return ""; } }
ByteUtil { public static String getValueAsString(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { return Bytes.toString(value); } else { return ""; } } }
ByteUtil { public static String getValueAsString(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { return Bytes.toString(value); } else { return ""; } } }
ByteUtil { public static String getValueAsString(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { return Bytes.toString(value); } else { return ""; } } static byte[][] split(byte[] source, byte[] separator); static byte[][] split(byte[] source, byte[] s...
ByteUtil { public static String getValueAsString(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { return Bytes.toString(value); } else { return ""; } } static byte[][] split(byte[] source, byte[] separator); static byte[][] split(byte[] source, byte[] s...
@Test public void testGetValueAsString2() { NavigableMap<byte[], byte[]> infoValues = new TreeMap<byte[], byte[]>(Bytes.BYTES_COMPARATOR); infoValues.put(Constants.VERSION_COLUMN_BYTES, Bytes.toBytes(JobDetailsValues.version)); assertEquals(JobDetailsValues.version, ByteUtil.getValueAsString(Constants.VERSION_COLUMN_BY...
public static String getValueAsString(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { return Bytes.toString(value); } else { return ""; } }
ByteUtil { public static String getValueAsString(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { return Bytes.toString(value); } else { return ""; } } }
ByteUtil { public static String getValueAsString(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { return Bytes.toString(value); } else { return ""; } } }
ByteUtil { public static String getValueAsString(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { return Bytes.toString(value); } else { return ""; } } static byte[][] split(byte[] source, byte[] separator); static byte[][] split(byte[] source, byte[] s...
ByteUtil { public static String getValueAsString(final byte[] key, final Map<byte[], byte[]> taskValues) { byte[] value = taskValues.get(key); if (value != null) { return Bytes.toString(value); } else { return ""; } } static byte[][] split(byte[] source, byte[] separator); static byte[][] split(byte[] source, byte[] s...
@Test(expected = IllegalArgumentException.class) public void testCreateJobHistoryFileParserNullCreation() { JobHistoryFileParser historyFileParser = JobHistoryFileParserFactory .createJobHistoryFileParser(null, null); assertNull(historyFileParser); }
public static JobHistoryFileParser createJobHistoryFileParser( byte[] historyFileContents, Configuration jobConf) throws IllegalArgumentException { if (historyFileContents == null) { throw new IllegalArgumentException( "Job history contents should not be null"); } HadoopVersion version = getVersion(historyFileContents)...
JobHistoryFileParserFactory { public static JobHistoryFileParser createJobHistoryFileParser( byte[] historyFileContents, Configuration jobConf) throws IllegalArgumentException { if (historyFileContents == null) { throw new IllegalArgumentException( "Job history contents should not be null"); } HadoopVersion version = g...
JobHistoryFileParserFactory { public static JobHistoryFileParser createJobHistoryFileParser( byte[] historyFileContents, Configuration jobConf) throws IllegalArgumentException { if (historyFileContents == null) { throw new IllegalArgumentException( "Job history contents should not be null"); } HadoopVersion version = g...
JobHistoryFileParserFactory { public static JobHistoryFileParser createJobHistoryFileParser( byte[] historyFileContents, Configuration jobConf) throws IllegalArgumentException { if (historyFileContents == null) { throw new IllegalArgumentException( "Job history contents should not be null"); } HadoopVersion version = g...
JobHistoryFileParserFactory { public static JobHistoryFileParser createJobHistoryFileParser( byte[] historyFileContents, Configuration jobConf) throws IllegalArgumentException { if (historyFileContents == null) { throw new IllegalArgumentException( "Job history contents should not be null"); } HadoopVersion version = g...
@Test public void testGetValueAsDouble() { NavigableMap<byte[], byte[]> infoValues = new TreeMap<byte[], byte[]>(Bytes.BYTES_COMPARATOR); double value = 34.567; double delta = 0.01; byte[] key = Bytes.toBytes("testingForDouble"); infoValues.put(key, Bytes.toBytes(value)); assertEquals(value, ByteUtil.getValueAsDouble(k...
public static double getValueAsDouble(byte[] key, NavigableMap<byte[], byte[]> infoValues) { byte[] value = infoValues.get(key); if (value != null) { return Bytes.toDouble(value); } else { return 0.0; } }
ByteUtil { public static double getValueAsDouble(byte[] key, NavigableMap<byte[], byte[]> infoValues) { byte[] value = infoValues.get(key); if (value != null) { return Bytes.toDouble(value); } else { return 0.0; } } }
ByteUtil { public static double getValueAsDouble(byte[] key, NavigableMap<byte[], byte[]> infoValues) { byte[] value = infoValues.get(key); if (value != null) { return Bytes.toDouble(value); } else { return 0.0; } } }
ByteUtil { public static double getValueAsDouble(byte[] key, NavigableMap<byte[], byte[]> infoValues) { byte[] value = infoValues.get(key); if (value != null) { return Bytes.toDouble(value); } else { return 0.0; } } static byte[][] split(byte[] source, byte[] separator); static byte[][] split(byte[] source, byte[] sep...
ByteUtil { public static double getValueAsDouble(byte[] key, NavigableMap<byte[], byte[]> infoValues) { byte[] value = infoValues.get(key); if (value != null) { return Bytes.toDouble(value); } else { return 0.0; } } static byte[][] split(byte[] source, byte[] separator); static byte[][] split(byte[] source, byte[] sep...
@Test public void testShouldRetain() { assertTrue(BatchUtil.shouldRetain(0, 1, 1)); assertTrue(BatchUtil.shouldRetain(5, 5, 10)); assertFalse(BatchUtil.shouldRetain(0, 1, 2)); assertFalse(BatchUtil.shouldRetain(4, 5, 10)); assertFalse(BatchUtil.shouldRetain(4, 100000, 155690)); }
public static boolean shouldRetain(int i, int maxRetention, int length) { int retentionCutoff = length - maxRetention; boolean retain = (i >= retentionCutoff) ? true : false; return retain; }
BatchUtil { public static boolean shouldRetain(int i, int maxRetention, int length) { int retentionCutoff = length - maxRetention; boolean retain = (i >= retentionCutoff) ? true : false; return retain; } }
BatchUtil { public static boolean shouldRetain(int i, int maxRetention, int length) { int retentionCutoff = length - maxRetention; boolean retain = (i >= retentionCutoff) ? true : false; return retain; } }
BatchUtil { public static boolean shouldRetain(int i, int maxRetention, int length) { int retentionCutoff = length - maxRetention; boolean retain = (i >= retentionCutoff) ? true : false; return retain; } static boolean shouldRetain(int i, int maxRetention, int length); static int getBatchCount(int length, int batchSiz...
BatchUtil { public static boolean shouldRetain(int i, int maxRetention, int length) { int retentionCutoff = length - maxRetention; boolean retain = (i >= retentionCutoff) ? true : false; return retain; } static boolean shouldRetain(int i, int maxRetention, int length); static int getBatchCount(int length, int batchSiz...
@Test public void testGetBatchCount() { assertEquals(0, BatchUtil.getBatchCount(0,0)); assertEquals(0, BatchUtil.getBatchCount(-1,0)); assertEquals(0, BatchUtil.getBatchCount(-2,4)); assertEquals(0, BatchUtil.getBatchCount(5,-7)); assertEquals(1, BatchUtil.getBatchCount(9,9)); assertEquals(1, BatchUtil.getBatchCount(9,...
public static int getBatchCount(int length, int batchSize) { if ((batchSize < 1) || (length < 1)) { return 0; } int remainder = length % batchSize; return (remainder > 0) ? (length / batchSize) + 1 : (length / batchSize); }
BatchUtil { public static int getBatchCount(int length, int batchSize) { if ((batchSize < 1) || (length < 1)) { return 0; } int remainder = length % batchSize; return (remainder > 0) ? (length / batchSize) + 1 : (length / batchSize); } }
BatchUtil { public static int getBatchCount(int length, int batchSize) { if ((batchSize < 1) || (length < 1)) { return 0; } int remainder = length % batchSize; return (remainder > 0) ? (length / batchSize) + 1 : (length / batchSize); } }
BatchUtil { public static int getBatchCount(int length, int batchSize) { if ((batchSize < 1) || (length < 1)) { return 0; } int remainder = length % batchSize; return (remainder > 0) ? (length / batchSize) + 1 : (length / batchSize); } static boolean shouldRetain(int i, int maxRetention, int length); static int getBat...
BatchUtil { public static int getBatchCount(int length, int batchSize) { if ((batchSize < 1) || (length < 1)) { return 0; } int remainder = length % batchSize; return (remainder > 0) ? (length / batchSize) + 1 : (length / batchSize); } static boolean shouldRetain(int i, int maxRetention, int length); static int getBat...
@Test public void testGetRanges() { List<Integer> list = Arrays.asList(1,2,3); List<Range<Integer>> rangeList = BatchUtil.getRanges(list, 1); assertEquals(3, rangeList.size()); assertEquals(Integer.valueOf(1), rangeList.get(0).getMin()); assertEquals(Integer.valueOf(1), rangeList.get(0).getMax()); assertEquals(Integer....
public static <E extends Comparable<E>> List<Range<E>> getRanges(Collection<E> collection, int batchSize) { List<Range<E>> rangeList = new LinkedList<Range<E>>(); E currentMin = null; if ((collection != null) && (collection.size() > 0) && (batchSize > 0)) { int index = 1; for (E element : collection) { if (currentMin =...
BatchUtil { public static <E extends Comparable<E>> List<Range<E>> getRanges(Collection<E> collection, int batchSize) { List<Range<E>> rangeList = new LinkedList<Range<E>>(); E currentMin = null; if ((collection != null) && (collection.size() > 0) && (batchSize > 0)) { int index = 1; for (E element : collection) { if (...
BatchUtil { public static <E extends Comparable<E>> List<Range<E>> getRanges(Collection<E> collection, int batchSize) { List<Range<E>> rangeList = new LinkedList<Range<E>>(); E currentMin = null; if ((collection != null) && (collection.size() > 0) && (batchSize > 0)) { int index = 1; for (E element : collection) { if (...
BatchUtil { public static <E extends Comparable<E>> List<Range<E>> getRanges(Collection<E> collection, int batchSize) { List<Range<E>> rangeList = new LinkedList<Range<E>>(); E currentMin = null; if ((collection != null) && (collection.size() > 0) && (batchSize > 0)) { int index = 1; for (E element : collection) { if (...
BatchUtil { public static <E extends Comparable<E>> List<Range<E>> getRanges(Collection<E> collection, int batchSize) { List<Range<E>> rangeList = new LinkedList<Range<E>>(); E currentMin = null; if ((collection != null) && (collection.size() > 0) && (batchSize > 0)) { int index = 1; for (E element : collection) { if (...
@Test public void testCreate() { MRJobDescFactory mrFac = new MRJobDescFactory(); Configuration conf = new Configuration(); conf.set(Constants.USER_CONF_KEY, "testuser"); QualifiedJobId qid = new QualifiedJobId("clusterId", "job_211212010355_45240"); JobDesc jd = null; jd = mrFac.create(qid, 1354772953639L, conf); Asse...
@Override JobDesc create(QualifiedJobId qualifiedJobId, long submitTimeMillis, Configuration jobConf) { String appId = getAppId(jobConf); long appSubmitTimeMillis = jobConf.getLong(Constants.MR_RUN_CONF_KEY, submitTimeMillis); return create(qualifiedJobId, jobConf, appId, Constants.UNKNOWN, Framework.NONE, appSubmitTim...
MRJobDescFactory extends JobDescFactoryBase { @Override JobDesc create(QualifiedJobId qualifiedJobId, long submitTimeMillis, Configuration jobConf) { String appId = getAppId(jobConf); long appSubmitTimeMillis = jobConf.getLong(Constants.MR_RUN_CONF_KEY, submitTimeMillis); return create(qualifiedJobId, jobConf, appId, C...
MRJobDescFactory extends JobDescFactoryBase { @Override JobDesc create(QualifiedJobId qualifiedJobId, long submitTimeMillis, Configuration jobConf) { String appId = getAppId(jobConf); long appSubmitTimeMillis = jobConf.getLong(Constants.MR_RUN_CONF_KEY, submitTimeMillis); return create(qualifiedJobId, jobConf, appId, C...
MRJobDescFactory extends JobDescFactoryBase { @Override JobDesc create(QualifiedJobId qualifiedJobId, long submitTimeMillis, Configuration jobConf) { String appId = getAppId(jobConf); long appSubmitTimeMillis = jobConf.getLong(Constants.MR_RUN_CONF_KEY, submitTimeMillis); return create(qualifiedJobId, jobConf, appId, C...
MRJobDescFactory extends JobDescFactoryBase { @Override JobDesc create(QualifiedJobId qualifiedJobId, long submitTimeMillis, Configuration jobConf) { String appId = getAppId(jobConf); long appSubmitTimeMillis = jobConf.getLong(Constants.MR_RUN_CONF_KEY, submitTimeMillis); return create(qualifiedJobId, jobConf, appId, C...
@Test public void testJobNameToBatchDesc() { PigJobDescFactory pigFactory = new PigJobDescFactory(); for (String[] inputOuput : testJobNames) { String input = inputOuput[0]; String expected = inputOuput[1]; String found = pigFactory.getAppIdFromJobName(input); assertEquals("Unexpected result found when parsing jobName=...
@Override String getAppIdFromJobName(String jobName) { if (jobName == null) { return null; } Matcher matcher = scheduledJobnamePattern.matcher(jobName); if (matcher.matches()) { jobName = SCHEDULED_PREFIX + matcher.group(1); } return jobName; }
PigJobDescFactory extends JobDescFactoryBase { @Override String getAppIdFromJobName(String jobName) { if (jobName == null) { return null; } Matcher matcher = scheduledJobnamePattern.matcher(jobName); if (matcher.matches()) { jobName = SCHEDULED_PREFIX + matcher.group(1); } return jobName; } }
PigJobDescFactory extends JobDescFactoryBase { @Override String getAppIdFromJobName(String jobName) { if (jobName == null) { return null; } Matcher matcher = scheduledJobnamePattern.matcher(jobName); if (matcher.matches()) { jobName = SCHEDULED_PREFIX + matcher.group(1); } return jobName; } }
PigJobDescFactory extends JobDescFactoryBase { @Override String getAppIdFromJobName(String jobName) { if (jobName == null) { return null; } Matcher matcher = scheduledJobnamePattern.matcher(jobName); if (matcher.matches()) { jobName = SCHEDULED_PREFIX + matcher.group(1); } return jobName; } @Override JobDesc create(Qu...
PigJobDescFactory extends JobDescFactoryBase { @Override String getAppIdFromJobName(String jobName) { if (jobName == null) { return null; } Matcher matcher = scheduledJobnamePattern.matcher(jobName); if (matcher.matches()) { jobName = SCHEDULED_PREFIX + matcher.group(1); } return jobName; } @Override JobDesc create(Qu...
@Test public void testLogFileToStartTime() { for (Object[] inputOuput : testLogFileNames) { String input = (String)inputOuput[0]; long expected = (Long)inputOuput[1]; long found = PigJobDescFactory.getScriptStartTimeFromLogfileName(input); assertEquals("Unexpected result found when parsing logFileName=" + input, expect...
public static long getScriptStartTimeFromLogfileName(String pigLogfile) { long pigSubmitTimeMillis = 0; if (pigLogfile == null) { return pigSubmitTimeMillis; } Matcher matcher = pigLogfilePattern.matcher(pigLogfile); if (matcher.matches()) { String submitTimeMillisString = matcher.group(1); pigSubmitTimeMillis = Long.p...
PigJobDescFactory extends JobDescFactoryBase { public static long getScriptStartTimeFromLogfileName(String pigLogfile) { long pigSubmitTimeMillis = 0; if (pigLogfile == null) { return pigSubmitTimeMillis; } Matcher matcher = pigLogfilePattern.matcher(pigLogfile); if (matcher.matches()) { String submitTimeMillisString =...
PigJobDescFactory extends JobDescFactoryBase { public static long getScriptStartTimeFromLogfileName(String pigLogfile) { long pigSubmitTimeMillis = 0; if (pigLogfile == null) { return pigSubmitTimeMillis; } Matcher matcher = pigLogfilePattern.matcher(pigLogfile); if (matcher.matches()) { String submitTimeMillisString =...
PigJobDescFactory extends JobDescFactoryBase { public static long getScriptStartTimeFromLogfileName(String pigLogfile) { long pigSubmitTimeMillis = 0; if (pigLogfile == null) { return pigSubmitTimeMillis; } Matcher matcher = pigLogfilePattern.matcher(pigLogfile); if (matcher.matches()) { String submitTimeMillisString =...
PigJobDescFactory extends JobDescFactoryBase { public static long getScriptStartTimeFromLogfileName(String pigLogfile) { long pigSubmitTimeMillis = 0; if (pigLogfile == null) { return pigSubmitTimeMillis; } Matcher matcher = pigLogfilePattern.matcher(pigLogfile); if (matcher.matches()) { String submitTimeMillisString =...
@Test public void testToString() { FlowKey key = new FlowKey("c1@local", "auser", "app", 1345L); String expected = "c1@local" + Constants.SEP + "auser" + Constants.SEP + "app" + Constants.SEP + 1345L; assertEquals(expected, key.toString()); }
public String toString() { return super.toString() + Constants.SEP + this.getRunId(); }
FlowKey extends AppKey implements Comparable<Object> { public String toString() { return super.toString() + Constants.SEP + this.getRunId(); } }
FlowKey extends AppKey implements Comparable<Object> { public String toString() { return super.toString() + Constants.SEP + this.getRunId(); } @JsonCreator FlowKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, @JsonProperty("appId") String appId, ...
FlowKey extends AppKey implements Comparable<Object> { public String toString() { return super.toString() + Constants.SEP + this.getRunId(); } @JsonCreator FlowKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, @JsonProperty("appId") String appId, ...
FlowKey extends AppKey implements Comparable<Object> { public String toString() { return super.toString() + Constants.SEP + this.getRunId(); } @JsonCreator FlowKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, @JsonProperty("appId") String appId, ...
@Test public void testConstructor1() throws Exception { HdfsStatsKey key1 = new HdfsStatsKey(cluster1, path1, now1); testKeyComponents(key1); assertEquals(key1.getQualifiedPathKey(), new QualifiedPathKey(cluster1, path1)); assertNull(key1.getQualifiedPathKey().getNamespace()); }
public QualifiedPathKey getQualifiedPathKey() { return pathKey; }
HdfsStatsKey implements Comparable<Object> { public QualifiedPathKey getQualifiedPathKey() { return pathKey; } }
HdfsStatsKey implements Comparable<Object> { public QualifiedPathKey getQualifiedPathKey() { return pathKey; } @JsonCreator HdfsStatsKey(@JsonProperty("cluster") String cluster, @JsonProperty("path") String path, @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator HdfsStatsK...
HdfsStatsKey implements Comparable<Object> { public QualifiedPathKey getQualifiedPathKey() { return pathKey; } @JsonCreator HdfsStatsKey(@JsonProperty("cluster") String cluster, @JsonProperty("path") String path, @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator HdfsStatsK...
HdfsStatsKey implements Comparable<Object> { public QualifiedPathKey getQualifiedPathKey() { return pathKey; } @JsonCreator HdfsStatsKey(@JsonProperty("cluster") String cluster, @JsonProperty("path") String path, @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator HdfsStatsK...
@Test public void testConstructorFederatedNS() throws Exception { HdfsStatsKey key1 = new HdfsStatsKey(cluster1, path1, namespace1, now1); testKeyComponents(key1); assertEquals(key1.getQualifiedPathKey(), new QualifiedPathKey(cluster1, path1, namespace1)); assertEquals(key1.getQualifiedPathKey().getNamespace(), namespa...
public QualifiedPathKey getQualifiedPathKey() { return pathKey; }
HdfsStatsKey implements Comparable<Object> { public QualifiedPathKey getQualifiedPathKey() { return pathKey; } }
HdfsStatsKey implements Comparable<Object> { public QualifiedPathKey getQualifiedPathKey() { return pathKey; } @JsonCreator HdfsStatsKey(@JsonProperty("cluster") String cluster, @JsonProperty("path") String path, @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator HdfsStatsK...
HdfsStatsKey implements Comparable<Object> { public QualifiedPathKey getQualifiedPathKey() { return pathKey; } @JsonCreator HdfsStatsKey(@JsonProperty("cluster") String cluster, @JsonProperty("path") String path, @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator HdfsStatsK...
HdfsStatsKey implements Comparable<Object> { public QualifiedPathKey getQualifiedPathKey() { return pathKey; } @JsonCreator HdfsStatsKey(@JsonProperty("cluster") String cluster, @JsonProperty("path") String path, @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator HdfsStatsK...
@Test(expected=ProcessingException.class) public void testIncorrectGetXmxValue(){ String xmxValue = "-XmxSOMETHINGWRONG!"; @SuppressWarnings("unused") long val = JobHistoryFileParserBase.getXmxValue(xmxValue); }
public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.substring(0, valueStr.length() - 1); retVal = Long.parseLong(x...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
@Test public void testConstructor2() throws Exception { QualifiedPathKey qk = new QualifiedPathKey(cluster1, path1); HdfsStatsKey key1 = new HdfsStatsKey(qk, now1); testKeyComponents(key1); assertEquals(key1.getQualifiedPathKey(), qk); }
public QualifiedPathKey getQualifiedPathKey() { return pathKey; }
HdfsStatsKey implements Comparable<Object> { public QualifiedPathKey getQualifiedPathKey() { return pathKey; } }
HdfsStatsKey implements Comparable<Object> { public QualifiedPathKey getQualifiedPathKey() { return pathKey; } @JsonCreator HdfsStatsKey(@JsonProperty("cluster") String cluster, @JsonProperty("path") String path, @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator HdfsStatsK...
HdfsStatsKey implements Comparable<Object> { public QualifiedPathKey getQualifiedPathKey() { return pathKey; } @JsonCreator HdfsStatsKey(@JsonProperty("cluster") String cluster, @JsonProperty("path") String path, @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator HdfsStatsK...
HdfsStatsKey implements Comparable<Object> { public QualifiedPathKey getQualifiedPathKey() { return pathKey; } @JsonCreator HdfsStatsKey(@JsonProperty("cluster") String cluster, @JsonProperty("path") String path, @JsonProperty("encodedRunId") long encodedRunId); @JsonCreator HdfsStatsK...
@Test public void testGetRunId() { long ts = 1392217200L; HdfsStatsKey key1 = new HdfsStatsKey(cluster1, path1, (Long.MAX_VALUE - ts)); assertEquals(key1.getRunId(), ts); }
public static long getRunId(long encodedRunId) { return Long.MAX_VALUE - encodedRunId; }
HdfsStatsKey implements Comparable<Object> { public static long getRunId(long encodedRunId) { return Long.MAX_VALUE - encodedRunId; } }
HdfsStatsKey implements Comparable<Object> { public static long getRunId(long encodedRunId) { return Long.MAX_VALUE - encodedRunId; } @JsonCreator HdfsStatsKey(@JsonProperty("cluster") String cluster, @JsonProperty("path") String path, @JsonProperty("encodedRunId") long encodedRunId); @...
HdfsStatsKey implements Comparable<Object> { public static long getRunId(long encodedRunId) { return Long.MAX_VALUE - encodedRunId; } @JsonCreator HdfsStatsKey(@JsonProperty("cluster") String cluster, @JsonProperty("path") String path, @JsonProperty("encodedRunId") long encodedRunId); @...
HdfsStatsKey implements Comparable<Object> { public static long getRunId(long encodedRunId) { return Long.MAX_VALUE - encodedRunId; } @JsonCreator HdfsStatsKey(@JsonProperty("cluster") String cluster, @JsonProperty("path") String path, @JsonProperty("encodedRunId") long encodedRunId); @...
@Test public void testCompareTo() { long ts = 1392217200L; HdfsStatsKey key1 = new HdfsStatsKey(cluster1, path1, (Long.MAX_VALUE - ts)); HdfsStatsKey key2 = new HdfsStatsKey(cluster1, path1, (Long.MAX_VALUE - ts - 10000)); assertTrue(key1.compareTo(key2) > 0); key2 = new HdfsStatsKey(cluster1, path1, (Long.MAX_VALUE - ...
@Override public int compareTo(Object other) { if (other == null) { return -1; } HdfsStatsKey otherKey = (HdfsStatsKey) other; return new CompareToBuilder() .append(this.pathKey, otherKey.getQualifiedPathKey()) .append(this.encodedRunId, otherKey.getEncodedRunId()) .toComparison(); }
HdfsStatsKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } HdfsStatsKey otherKey = (HdfsStatsKey) other; return new CompareToBuilder() .append(this.pathKey, otherKey.getQualifiedPathKey()) .append(this.encodedRunId, otherKey.getEncodedRunId()) .toCompar...
HdfsStatsKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } HdfsStatsKey otherKey = (HdfsStatsKey) other; return new CompareToBuilder() .append(this.pathKey, otherKey.getQualifiedPathKey()) .append(this.encodedRunId, otherKey.getEncodedRunId()) .toCompar...
HdfsStatsKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } HdfsStatsKey otherKey = (HdfsStatsKey) other; return new CompareToBuilder() .append(this.pathKey, otherKey.getQualifiedPathKey()) .append(this.encodedRunId, otherKey.getEncodedRunId()) .toCompar...
HdfsStatsKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } HdfsStatsKey otherKey = (HdfsStatsKey) other; return new CompareToBuilder() .append(this.pathKey, otherKey.getQualifiedPathKey()) .append(this.encodedRunId, otherKey.getEncodedRunId()) .toCompar...
@Test public void testToString() { AppKey key = new AppKey("c1@local", "auser", "app"); String expected = "c1@local" + Constants.SEP + "auser" + Constants.SEP + "app"; assertEquals(expected, key.toString()); }
public String toString() { return getCluster() + Constants.SEP + getUserName() + Constants.SEP + getAppId(); }
AppKey implements Comparable<Object> { public String toString() { return getCluster() + Constants.SEP + getUserName() + Constants.SEP + getAppId(); } }
AppKey implements Comparable<Object> { public String toString() { return getCluster() + Constants.SEP + getUserName() + Constants.SEP + getAppId(); } @JsonCreator AppKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, @JsonProperty("appId") String appId); }
AppKey implements Comparable<Object> { public String toString() { return getCluster() + Constants.SEP + getUserName() + Constants.SEP + getAppId(); } @JsonCreator AppKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, @JsonProperty("appId") String appId); String getCluster(); ...
AppKey implements Comparable<Object> { public String toString() { return getCluster() + Constants.SEP + getUserName() + Constants.SEP + getAppId(); } @JsonCreator AppKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, @JsonProperty("appId") String appId); String getCluster(); ...
@Test public void testJobIdOrdering() { String job1 = "job_20120101000000_0001"; String job2 = "job_20120101000000_1111"; String job3 = "job_20120101000000_2222"; String job4 = "job_20120101000000_11111"; String job5 = "job_20120201000000_0001"; JobId jobId1 = new JobId(job1); JobId jobId2 = new JobId(job2); JobId jobI...
@Override public int compareTo(JobId o) { if (o == null) { return -1; } return new CompareToBuilder() .append(this.jobEpoch, o.getJobEpoch()) .append(this.jobSequence, o.getJobSequence()) .toComparison(); }
JobId implements Comparable<JobId> { @Override public int compareTo(JobId o) { if (o == null) { return -1; } return new CompareToBuilder() .append(this.jobEpoch, o.getJobEpoch()) .append(this.jobSequence, o.getJobSequence()) .toComparison(); } }
JobId implements Comparable<JobId> { @Override public int compareTo(JobId o) { if (o == null) { return -1; } return new CompareToBuilder() .append(this.jobEpoch, o.getJobEpoch()) .append(this.jobSequence, o.getJobSequence()) .toComparison(); } @JsonCreator JobId(@JsonProperty("jobIdString") String jobId); JobId(long ...
JobId implements Comparable<JobId> { @Override public int compareTo(JobId o) { if (o == null) { return -1; } return new CompareToBuilder() .append(this.jobEpoch, o.getJobEpoch()) .append(this.jobSequence, o.getJobSequence()) .toComparison(); } @JsonCreator JobId(@JsonProperty("jobIdString") String jobId); JobId(long ...
JobId implements Comparable<JobId> { @Override public int compareTo(JobId o) { if (o == null) { return -1; } return new CompareToBuilder() .append(this.jobEpoch, o.getJobEpoch()) .append(this.jobSequence, o.getJobSequence()) .toComparison(); } @JsonCreator JobId(@JsonProperty("jobIdString") String jobId); JobId(long ...
@Test public void testAppIdParsing() throws Exception { String username = "testuser"; Configuration c = new Configuration(); c.set("mapred.job.name", jobName1); c.set("user.name", username); c.set("cascading.app.id", "93543E9B29A4CD14E0556849A93E171B"); c.set("cascading.flow.id", "0A2CEB3C5DFB905802EB96D1AE0C04D5"); Sc...
@Override JobDesc create(QualifiedJobId qualifiedJobId, long submitTimeMillis, Configuration jobConf) { String appId = getAppId(jobConf); if (Constants.UNKNOWN.equals(appId)) { appId = cleanAppId(jobConf.get(Constants.CASCADING_APP_ID_CONF_KEY)); } String version = jobConf.get(Constants.CASCADING_VERSION_CONF_KEY); lon...
ScaldingJobDescFactory extends JobDescFactoryBase { @Override JobDesc create(QualifiedJobId qualifiedJobId, long submitTimeMillis, Configuration jobConf) { String appId = getAppId(jobConf); if (Constants.UNKNOWN.equals(appId)) { appId = cleanAppId(jobConf.get(Constants.CASCADING_APP_ID_CONF_KEY)); } String version = jo...
ScaldingJobDescFactory extends JobDescFactoryBase { @Override JobDesc create(QualifiedJobId qualifiedJobId, long submitTimeMillis, Configuration jobConf) { String appId = getAppId(jobConf); if (Constants.UNKNOWN.equals(appId)) { appId = cleanAppId(jobConf.get(Constants.CASCADING_APP_ID_CONF_KEY)); } String version = jo...
ScaldingJobDescFactory extends JobDescFactoryBase { @Override JobDesc create(QualifiedJobId qualifiedJobId, long submitTimeMillis, Configuration jobConf) { String appId = getAppId(jobConf); if (Constants.UNKNOWN.equals(appId)) { appId = cleanAppId(jobConf.get(Constants.CASCADING_APP_ID_CONF_KEY)); } String version = jo...
ScaldingJobDescFactory extends JobDescFactoryBase { @Override JobDesc create(QualifiedJobId qualifiedJobId, long submitTimeMillis, Configuration jobConf) { String appId = getAppId(jobConf); if (Constants.UNKNOWN.equals(appId)) { appId = cleanAppId(jobConf.get(Constants.CASCADING_APP_ID_CONF_KEY)); } String version = jo...
@Test public void testStripAppId() throws Exception { ScaldingJobDescFactory factory = new ScaldingJobDescFactory(); assertEquals(expectedAppId1, factory.stripAppId(jobName1)); assertEquals(expectedAppId2, factory.stripAppId(jobName2)); assertEquals(expectedAppId3, factory.stripAppId(jobName3)); assertEquals(expectedAp...
String stripAppId(String origId) { if (origId == null || origId.isEmpty()) { return ""; } Matcher m = stripBracketsPattern.matcher(origId); String cleanedAppId = m.replaceAll(""); Matcher tailMatcher = stripSequencePattern.matcher(cleanedAppId); if (tailMatcher.matches()) { cleanedAppId = tailMatcher.group(1); } return...
ScaldingJobDescFactory extends JobDescFactoryBase { String stripAppId(String origId) { if (origId == null || origId.isEmpty()) { return ""; } Matcher m = stripBracketsPattern.matcher(origId); String cleanedAppId = m.replaceAll(""); Matcher tailMatcher = stripSequencePattern.matcher(cleanedAppId); if (tailMatcher.matche...
ScaldingJobDescFactory extends JobDescFactoryBase { String stripAppId(String origId) { if (origId == null || origId.isEmpty()) { return ""; } Matcher m = stripBracketsPattern.matcher(origId); String cleanedAppId = m.replaceAll(""); Matcher tailMatcher = stripSequencePattern.matcher(cleanedAppId); if (tailMatcher.matche...
ScaldingJobDescFactory extends JobDescFactoryBase { String stripAppId(String origId) { if (origId == null || origId.isEmpty()) { return ""; } Matcher m = stripBracketsPattern.matcher(origId); String cleanedAppId = m.replaceAll(""); Matcher tailMatcher = stripSequencePattern.matcher(cleanedAppId); if (tailMatcher.matche...
ScaldingJobDescFactory extends JobDescFactoryBase { String stripAppId(String origId) { if (origId == null || origId.isEmpty()) { return ""; } Matcher m = stripBracketsPattern.matcher(origId); String cleanedAppId = m.replaceAll(""); Matcher tailMatcher = stripSequencePattern.matcher(cleanedAppId); if (tailMatcher.matche...
@Test public void testRunIdParsing() throws Exception { Configuration c = new Configuration(); c.set("mapred.job.name", jobName1); c.set("cascading.app.id", "93543E9B29A4CD14E0556849A93E171B"); c.set("cascading.flow.id", "0A2CEB3C5DFB905802EB96D1AE0C04D5"); c.set("user.name", "testuser"); ScaldingJobDescFactory factory...
@Override JobDesc create(QualifiedJobId qualifiedJobId, long submitTimeMillis, Configuration jobConf) { String appId = getAppId(jobConf); if (Constants.UNKNOWN.equals(appId)) { appId = cleanAppId(jobConf.get(Constants.CASCADING_APP_ID_CONF_KEY)); } String version = jobConf.get(Constants.CASCADING_VERSION_CONF_KEY); lon...
ScaldingJobDescFactory extends JobDescFactoryBase { @Override JobDesc create(QualifiedJobId qualifiedJobId, long submitTimeMillis, Configuration jobConf) { String appId = getAppId(jobConf); if (Constants.UNKNOWN.equals(appId)) { appId = cleanAppId(jobConf.get(Constants.CASCADING_APP_ID_CONF_KEY)); } String version = jo...
ScaldingJobDescFactory extends JobDescFactoryBase { @Override JobDesc create(QualifiedJobId qualifiedJobId, long submitTimeMillis, Configuration jobConf) { String appId = getAppId(jobConf); if (Constants.UNKNOWN.equals(appId)) { appId = cleanAppId(jobConf.get(Constants.CASCADING_APP_ID_CONF_KEY)); } String version = jo...
ScaldingJobDescFactory extends JobDescFactoryBase { @Override JobDesc create(QualifiedJobId qualifiedJobId, long submitTimeMillis, Configuration jobConf) { String appId = getAppId(jobConf); if (Constants.UNKNOWN.equals(appId)) { appId = cleanAppId(jobConf.get(Constants.CASCADING_APP_ID_CONF_KEY)); } String version = jo...
ScaldingJobDescFactory extends JobDescFactoryBase { @Override JobDesc create(QualifiedJobId qualifiedJobId, long submitTimeMillis, Configuration jobConf) { String appId = getAppId(jobConf); if (Constants.UNKNOWN.equals(appId)) { appId = cleanAppId(jobConf.get(Constants.CASCADING_APP_ID_CONF_KEY)); } String version = jo...
@Test public void TestGetLastHourInvertedTimestamp() throws IOException { long ts = 1391896800L; long expectedTop = Long.MAX_VALUE - ts; long actualTop = HdfsStatsService.getEncodedRunId(ts); assertEquals(actualTop, expectedTop); }
public static long getEncodedRunId(long now) { long lastHour = now - (now % 3600); return (Long.MAX_VALUE - lastHour); }
HdfsStatsService { public static long getEncodedRunId(long now) { long lastHour = now - (now % 3600); return (Long.MAX_VALUE - lastHour); } }
HdfsStatsService { public static long getEncodedRunId(long now) { long lastHour = now - (now % 3600); return (Long.MAX_VALUE - lastHour); } HdfsStatsService(Configuration hbaseConf, Connection hbaseConnection); }
HdfsStatsService { public static long getEncodedRunId(long now) { long lastHour = now - (now % 3600); return (Long.MAX_VALUE - lastHour); } HdfsStatsService(Configuration hbaseConf, Connection hbaseConnection); static long getEncodedRunId(long now); List<HdfsStats> getAllDirs(String cluster, String pathPrefix, in...
HdfsStatsService { public static long getEncodedRunId(long now) { long lastHour = now - (now % 3600); return (Long.MAX_VALUE - lastHour); } HdfsStatsService(Configuration hbaseConf, Connection hbaseConnection); static long getEncodedRunId(long now); List<HdfsStats> getAllDirs(String cluster, String pathPrefix, in...
@Test public void TestGetOlderRunId() { long ts = 1392123600L; int retryCount = 0; for (int i = 0; i < HdfsConstants.ageMult.length; i++) { long oldts = HdfsStatsService.getOlderRunId(retryCount, ts); long diff = (ts - oldts) / HdfsConstants.NUM_SECONDS_IN_A_DAY; assertTrue(diff <= HdfsConstants.ageMult[retryCount]); r...
public static long getOlderRunId(int i, long runId) { int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600; if (i >= HdfsConstants.ageMult.length) { throw new ProcessingException("Can't look back in time that far " + i + ", only upto " + HdfsConstants.ageMult.length); } long newTs = runId - (HdfsConstants.ag...
HdfsStatsService { public static long getOlderRunId(int i, long runId) { int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600; if (i >= HdfsConstants.ageMult.length) { throw new ProcessingException("Can't look back in time that far " + i + ", only upto " + HdfsConstants.ageMult.length); } long newTs = runId ...
HdfsStatsService { public static long getOlderRunId(int i, long runId) { int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600; if (i >= HdfsConstants.ageMult.length) { throw new ProcessingException("Can't look back in time that far " + i + ", only upto " + HdfsConstants.ageMult.length); } long newTs = runId ...
HdfsStatsService { public static long getOlderRunId(int i, long runId) { int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600; if (i >= HdfsConstants.ageMult.length) { throw new ProcessingException("Can't look back in time that far " + i + ", only upto " + HdfsConstants.ageMult.length); } long newTs = runId ...
HdfsStatsService { public static long getOlderRunId(int i, long runId) { int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600; if (i >= HdfsConstants.ageMult.length) { throw new ProcessingException("Can't look back in time that far " + i + ", only upto " + HdfsConstants.ageMult.length); } long newTs = runId ...
@Test public void testNullGetXmxValue(){ String xmxValue = null; Long val = JobHistoryFileParserBase.getXmxValue(xmxValue); assertEquals(Constants.DEFAULT_XMX_SETTING, val); }
public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.substring(0, valueStr.length() - 1); retVal = Long.parseLong(x...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
@Test public void TestGetAllDirsPathSpecialChars() throws IOException { HdfsStatsService hs = new HdfsStatsService(UTIL.getConfiguration(), hbaseConnection); long ts = 1392217200L; String cluster1 = "cluster1"; String rootPath = "/dirSpecialChars/"; String pathPrefix = "dir2 dir2!!! dir3"; loadHdfsUsageStats(cluster1, ...
public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { rowPrefixStr += HdfsConstants.SEP + Stri...
HdfsStatsService { public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { rowPrefixStr += HdfsC...
HdfsStatsService { public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { rowPrefixStr += HdfsC...
HdfsStatsService { public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { rowPrefixStr += HdfsC...
HdfsStatsService { public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { rowPrefixStr += HdfsC...
@Test public void TestGetAllDirsEmpty() throws IOException { HdfsStatsService hs = new HdfsStatsService(UTIL.getConfiguration(), hbaseConnection); long ts = 1392217200L; String cluster1 = "cluster1"; String pathPrefix = "/dir1/"; List<HdfsStats> h1 = hs.getAllDirs(cluster1, pathPrefix, 10, (Long.MAX_VALUE - ts)); asser...
public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { rowPrefixStr += HdfsConstants.SEP + Stri...
HdfsStatsService { public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { rowPrefixStr += HdfsC...
HdfsStatsService { public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { rowPrefixStr += HdfsC...
HdfsStatsService { public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { rowPrefixStr += HdfsC...
HdfsStatsService { public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { rowPrefixStr += HdfsC...
@Test(expected = ProcessingException.class) public void testGetOlderRunIdsException() { int i = HdfsConstants.ageMult.length + 10; HdfsStatsService.getOlderRunId(i, System.currentTimeMillis() / 1000); }
public static long getOlderRunId(int i, long runId) { int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600; if (i >= HdfsConstants.ageMult.length) { throw new ProcessingException("Can't look back in time that far " + i + ", only upto " + HdfsConstants.ageMult.length); } long newTs = runId - (HdfsConstants.ag...
HdfsStatsService { public static long getOlderRunId(int i, long runId) { int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600; if (i >= HdfsConstants.ageMult.length) { throw new ProcessingException("Can't look back in time that far " + i + ", only upto " + HdfsConstants.ageMult.length); } long newTs = runId ...
HdfsStatsService { public static long getOlderRunId(int i, long runId) { int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600; if (i >= HdfsConstants.ageMult.length) { throw new ProcessingException("Can't look back in time that far " + i + ", only upto " + HdfsConstants.ageMult.length); } long newTs = runId ...
HdfsStatsService { public static long getOlderRunId(int i, long runId) { int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600; if (i >= HdfsConstants.ageMult.length) { throw new ProcessingException("Can't look back in time that far " + i + ", only upto " + HdfsConstants.ageMult.length); } long newTs = runId ...
HdfsStatsService { public static long getOlderRunId(int i, long runId) { int randomizedHourInSeconds = (int) (Math.random() * 23) * 3600; if (i >= HdfsConstants.ageMult.length) { throw new ProcessingException("Can't look back in time that far " + i + ", only upto " + HdfsConstants.ageMult.length); } long newTs = runId ...
@Test public void TestGetAllDirs() throws IOException { HdfsStatsService hs = new HdfsStatsService(UTIL.getConfiguration(), hbaseConnection); long ts = 1392217200L; String cluster1 = "getAllDirsCluster1"; String pathPrefix = "/all_dirs_dir1/"; long encodedRunId = (Long.MAX_VALUE - ts); loadHdfsData(encodedRunId, cluste...
public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { rowPrefixStr += HdfsConstants.SEP + Stri...
HdfsStatsService { public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { rowPrefixStr += HdfsC...
HdfsStatsService { public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { rowPrefixStr += HdfsC...
HdfsStatsService { public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { rowPrefixStr += HdfsC...
HdfsStatsService { public List<HdfsStats> getAllDirs(String cluster, String pathPrefix, int limit, long runId) throws IOException { long encodedRunId = getEncodedRunId(runId); String rowPrefixStr = Long.toString(encodedRunId) + HdfsConstants.SEP + cluster; if (StringUtils.isNotEmpty(pathPrefix)) { rowPrefixStr += HdfsC...
@Test public void testFuzzy() throws IOException { final long startts = 1392217200L; String cluster1 = "cluster1_timeseries"; String pathPrefix = "/dir_timeseries/dir12345"; String pathhello = "/hello1/hello2"; int numberStatsExpected = 5; loadTimeSeries(cluster1, pathPrefix, numberStatsExpected, startts); loadTimeSeri...
public List<HdfsStats> getHdfsTimeSeriesStats(String cluster, String path, int limit, long starttime, long endtime) throws IOException { Scan scan = GenerateScanFuzzy(starttime, endtime, cluster, path); return createFromScanResults(cluster, path, scan, limit, Boolean.TRUE, starttime, endtime); }
HdfsStatsService { public List<HdfsStats> getHdfsTimeSeriesStats(String cluster, String path, int limit, long starttime, long endtime) throws IOException { Scan scan = GenerateScanFuzzy(starttime, endtime, cluster, path); return createFromScanResults(cluster, path, scan, limit, Boolean.TRUE, starttime, endtime); } }
HdfsStatsService { public List<HdfsStats> getHdfsTimeSeriesStats(String cluster, String path, int limit, long starttime, long endtime) throws IOException { Scan scan = GenerateScanFuzzy(starttime, endtime, cluster, path); return createFromScanResults(cluster, path, scan, limit, Boolean.TRUE, starttime, endtime); } Hdfs...
HdfsStatsService { public List<HdfsStats> getHdfsTimeSeriesStats(String cluster, String path, int limit, long starttime, long endtime) throws IOException { Scan scan = GenerateScanFuzzy(starttime, endtime, cluster, path); return createFromScanResults(cluster, path, scan, limit, Boolean.TRUE, starttime, endtime); } Hdfs...
HdfsStatsService { public List<HdfsStats> getHdfsTimeSeriesStats(String cluster, String path, int limit, long starttime, long endtime) throws IOException { Scan scan = GenerateScanFuzzy(starttime, endtime, cluster, path); return createFromScanResults(cluster, path, scan, limit, Boolean.TRUE, starttime, endtime); } Hdfs...
@Test public void testGetJobByJobID() throws Exception { flowDataGen.loadFlow("c1@local", "buser", "getJobByJobID", 1234, "a", 3, 10, idService, historyTable); JobHistoryService service = null; service = new JobHistoryService(UTIL.getConfiguration(), hbaseConnection); Flow flow = service.getLatestFlow("c1@local", "buse...
public JobDetails getJobByJobID(String cluster, String jobId) throws IOException { return getJobByJobID(cluster, jobId, false); }
JobHistoryService { public JobDetails getJobByJobID(String cluster, String jobId) throws IOException { return getJobByJobID(cluster, jobId, false); } }
JobHistoryService { public JobDetails getJobByJobID(String cluster, String jobId) throws IOException { return getJobByJobID(cluster, jobId, false); } JobHistoryService(Configuration hbaseConf, Connection hbaseConnection); }
JobHistoryService { public JobDetails getJobByJobID(String cluster, String jobId) throws IOException { return getJobByJobID(cluster, jobId, false); } JobHistoryService(Configuration hbaseConf, Connection hbaseConnection); Flow getLatestFlow(String cluster, String user, String appId); Flow getLatestFlow(String cluster, ...
JobHistoryService { public JobDetails getJobByJobID(String cluster, String jobId) throws IOException { return getJobByJobID(cluster, jobId, false); } JobHistoryService(Configuration hbaseConf, Connection hbaseConnection); Flow getLatestFlow(String cluster, String user, String appId); Flow getLatestFlow(String cluster, ...
@Test public void testGetFlowTimeSeriesStats() throws Exception { final short numJobsAppOne = 3; final short numJobsAppTwo = 4; final long baseStats = 10L; flowDataGen.loadFlow("c1@local", "buser", "AppOne", 1234, "a", numJobsAppOne, baseStats, idService, historyTable); flowDataGen.loadFlow("c1@local", "buser", "AppTwo...
public List<Flow> getFlowTimeSeriesStats(String cluster, String user, String appId, String version, long startTime, long endTime, int limit, byte[] startRow) throws IOException { byte[] rowPrefix = Bytes.toBytes((cluster + Constants.SEP + user + Constants.SEP + appId + Constants.SEP)); byte[] scanStartRow; if (startRow...
JobHistoryService { public List<Flow> getFlowTimeSeriesStats(String cluster, String user, String appId, String version, long startTime, long endTime, int limit, byte[] startRow) throws IOException { byte[] rowPrefix = Bytes.toBytes((cluster + Constants.SEP + user + Constants.SEP + appId + Constants.SEP)); byte[] scanSt...
JobHistoryService { public List<Flow> getFlowTimeSeriesStats(String cluster, String user, String appId, String version, long startTime, long endTime, int limit, byte[] startRow) throws IOException { byte[] rowPrefix = Bytes.toBytes((cluster + Constants.SEP + user + Constants.SEP + appId + Constants.SEP)); byte[] scanSt...
JobHistoryService { public List<Flow> getFlowTimeSeriesStats(String cluster, String user, String appId, String version, long startTime, long endTime, int limit, byte[] startRow) throws IOException { byte[] rowPrefix = Bytes.toBytes((cluster + Constants.SEP + user + Constants.SEP + appId + Constants.SEP)); byte[] scanSt...
JobHistoryService { public List<Flow> getFlowTimeSeriesStats(String cluster, String user, String appId, String version, long startTime, long endTime, int limit, byte[] startRow) throws IOException { byte[] rowPrefix = Bytes.toBytes((cluster + Constants.SEP + user + Constants.SEP + appId + Constants.SEP)); byte[] scanSt...
@Test public void testRemoveJob() throws Exception { flowDataGen.loadFlow("c1@local", "ruser", "removeJob", 1234, "a", 3, 10, idService, historyTable); JobHistoryService service = new JobHistoryService(UTIL.getConfiguration(), hbaseConnection); Flow flow = service.getLatestFlow("c1@local", "ruser", "removeJob"); assert...
public int removeJob(JobKey key) throws IOException { byte[] jobRow = jobKeyConv.toBytes(key); Table historyTable = hbaseConnection.getTable(TableName.valueOf(Constants.HISTORY_TABLE)); historyTable.delete(new Delete(jobRow)); historyTable.close(); int deleteCount = 1; Scan taskScan = getTaskScan(key); taskScan.addColu...
JobHistoryService { public int removeJob(JobKey key) throws IOException { byte[] jobRow = jobKeyConv.toBytes(key); Table historyTable = hbaseConnection.getTable(TableName.valueOf(Constants.HISTORY_TABLE)); historyTable.delete(new Delete(jobRow)); historyTable.close(); int deleteCount = 1; Scan taskScan = getTaskScan(ke...
JobHistoryService { public int removeJob(JobKey key) throws IOException { byte[] jobRow = jobKeyConv.toBytes(key); Table historyTable = hbaseConnection.getTable(TableName.valueOf(Constants.HISTORY_TABLE)); historyTable.delete(new Delete(jobRow)); historyTable.close(); int deleteCount = 1; Scan taskScan = getTaskScan(ke...
JobHistoryService { public int removeJob(JobKey key) throws IOException { byte[] jobRow = jobKeyConv.toBytes(key); Table historyTable = hbaseConnection.getTable(TableName.valueOf(Constants.HISTORY_TABLE)); historyTable.delete(new Delete(jobRow)); historyTable.close(); int deleteCount = 1; Scan taskScan = getTaskScan(ke...
JobHistoryService { public int removeJob(JobKey key) throws IOException { byte[] jobRow = jobKeyConv.toBytes(key); Table historyTable = hbaseConnection.getTable(TableName.valueOf(Constants.HISTORY_TABLE)); historyTable.delete(new Delete(jobRow)); historyTable.close(); int deleteCount = 1; Scan taskScan = getTaskScan(ke...
@Test public void testSetHravenQueueName() throws FileNotFoundException { final String JOB_CONF_FILE_NAME = "src/test/resources/job_1329348432655_0001_conf.xml"; Configuration jobConf = new Configuration(); jobConf.addResource(new FileInputStream(JOB_CONF_FILE_NAME)); String USERNAME = "user"; JobKey jobKey = new JobKe...
static void setHravenQueueNamePut(Configuration jobConf, Put jobPut, JobKey jobKey, byte[] jobConfColumnPrefix) { String hRavenQueueName = HadoopConfUtil.getQueueName(jobConf); if (hRavenQueueName.equalsIgnoreCase(Constants.DEFAULT_VALUE_QUEUENAME)) { hRavenQueueName = jobKey.getUserName(); } byte[] column = Bytes.add(...
JobHistoryService { static void setHravenQueueNamePut(Configuration jobConf, Put jobPut, JobKey jobKey, byte[] jobConfColumnPrefix) { String hRavenQueueName = HadoopConfUtil.getQueueName(jobConf); if (hRavenQueueName.equalsIgnoreCase(Constants.DEFAULT_VALUE_QUEUENAME)) { hRavenQueueName = jobKey.getUserName(); } byte[]...
JobHistoryService { static void setHravenQueueNamePut(Configuration jobConf, Put jobPut, JobKey jobKey, byte[] jobConfColumnPrefix) { String hRavenQueueName = HadoopConfUtil.getQueueName(jobConf); if (hRavenQueueName.equalsIgnoreCase(Constants.DEFAULT_VALUE_QUEUENAME)) { hRavenQueueName = jobKey.getUserName(); } byte[]...
JobHistoryService { static void setHravenQueueNamePut(Configuration jobConf, Put jobPut, JobKey jobKey, byte[] jobConfColumnPrefix) { String hRavenQueueName = HadoopConfUtil.getQueueName(jobConf); if (hRavenQueueName.equalsIgnoreCase(Constants.DEFAULT_VALUE_QUEUENAME)) { hRavenQueueName = jobKey.getUserName(); } byte[]...
JobHistoryService { static void setHravenQueueNamePut(Configuration jobConf, Put jobPut, JobKey jobKey, byte[] jobConfColumnPrefix) { String hRavenQueueName = HadoopConfUtil.getQueueName(jobConf); if (hRavenQueueName.equalsIgnoreCase(Constants.DEFAULT_VALUE_QUEUENAME)) { hRavenQueueName = jobKey.getUserName(); } byte[]...
@Test public void testNewJobs() throws Exception { Configuration hbaseConfiguration = UTIL.getConfiguration(); String cluster1 = "newJobsClusterName"; String appId = "getNewJobs"; String appId2 = "getNewJobs2"; String user = "testuser"; JobHistoryService jhs = new JobHistoryService(hbaseConfiguration, hbaseConnection);...
public List<AppSummary> getNewApps(JobHistoryService jhs, String cluster, String user, long startTime, long endTime, int limit) throws IOException { byte[] startRow = null; if (StringUtils.isNotBlank(user)) { startRow = ByteUtil.join(Constants.SEP_BYTES, Bytes.toBytes(cluster), Bytes.toBytes(user)); } else { startRow =...
AppSummaryService { public List<AppSummary> getNewApps(JobHistoryService jhs, String cluster, String user, long startTime, long endTime, int limit) throws IOException { byte[] startRow = null; if (StringUtils.isNotBlank(user)) { startRow = ByteUtil.join(Constants.SEP_BYTES, Bytes.toBytes(cluster), Bytes.toBytes(user));...
AppSummaryService { public List<AppSummary> getNewApps(JobHistoryService jhs, String cluster, String user, long startTime, long endTime, int limit) throws IOException { byte[] startRow = null; if (StringUtils.isNotBlank(user)) { startRow = ByteUtil.join(Constants.SEP_BYTES, Bytes.toBytes(cluster), Bytes.toBytes(user));...
AppSummaryService { public List<AppSummary> getNewApps(JobHistoryService jhs, String cluster, String user, long startTime, long endTime, int limit) throws IOException { byte[] startRow = null; if (StringUtils.isNotBlank(user)) { startRow = ByteUtil.join(Constants.SEP_BYTES, Bytes.toBytes(cluster), Bytes.toBytes(user));...
AppSummaryService { public List<AppSummary> getNewApps(JobHistoryService jhs, String cluster, String user, long startTime, long endTime, int limit) throws IOException { byte[] startRow = null; if (StringUtils.isNotBlank(user)) { startRow = ByteUtil.join(Constants.SEP_BYTES, Bytes.toBytes(cluster), Bytes.toBytes(user));...
@Test public void testGetXmxValue(){ String xmxValue = "-Xmx500m"; long expValue = 500; long actualValue = JobHistoryFileParserBase.getXmxValue(xmxValue); assertEquals(expValue, actualValue); long totalValue = JobHistoryFileParserBase.getXmxTotal(actualValue); assertEquals(666L, totalValue); xmxValue = "-Xmx2048K"; act...
public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.substring(0, valueStr.length() - 1); retVal = Long.parseLong(x...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
JobHistoryFileParserBase implements JobHistoryFileParser { public static long getXmxValue(String javaChildOptsStr) { long retVal = 0L; String valueStr = extractXmxValueStr(javaChildOptsStr); char lastChar = valueStr.charAt(valueStr.length() - 1); try { if (Character.isLetter(lastChar)) { String xmxValStr = valueStr.sub...
@Test public void testGetDayTimestamp() throws IOException { long ts = 1402698420000L; long expectedTop = 1402617600000L; AppSummaryService appSummaryService = new AppSummaryService(hbaseConnection); assertEquals((Long) expectedTop, (Long) appSummaryService.getTimestamp(ts, AggregationConstants.AGGREGATION_TYPE.DAILY))...
long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) { if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) { long dayTimestamp = runId - (runId % Constants.MILLIS_ONE_DAY); return dayTimestamp; } else if (AggregationConstants.AGGREGATION_TYPE.WEEKLY.equals(aggType)) { Calendar c = C...
AppSummaryService { long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) { if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) { long dayTimestamp = runId - (runId % Constants.MILLIS_ONE_DAY); return dayTimestamp; } else if (AggregationConstants.AGGREGATION_TYPE.WEEKLY.equals(aggTyp...
AppSummaryService { long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) { if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) { long dayTimestamp = runId - (runId % Constants.MILLIS_ONE_DAY); return dayTimestamp; } else if (AggregationConstants.AGGREGATION_TYPE.WEEKLY.equals(aggTyp...
AppSummaryService { long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) { if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) { long dayTimestamp = runId - (runId % Constants.MILLIS_ONE_DAY); return dayTimestamp; } else if (AggregationConstants.AGGREGATION_TYPE.WEEKLY.equals(aggTyp...
AppSummaryService { long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) { if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) { long dayTimestamp = runId - (runId % Constants.MILLIS_ONE_DAY); return dayTimestamp; } else if (AggregationConstants.AGGREGATION_TYPE.WEEKLY.equals(aggTyp...
@Test public void testGetWeekTimestamp() throws IOException { long ts = 1402698420000L; long expectedTop = 1402185600000L; AppSummaryService appSummaryService = new AppSummaryService(hbaseConnection); assertEquals((Long) expectedTop, (Long) appSummaryService.getTimestamp(ts, AggregationConstants.AGGREGATION_TYPE.WEEKLY...
long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) { if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) { long dayTimestamp = runId - (runId % Constants.MILLIS_ONE_DAY); return dayTimestamp; } else if (AggregationConstants.AGGREGATION_TYPE.WEEKLY.equals(aggType)) { Calendar c = C...
AppSummaryService { long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) { if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) { long dayTimestamp = runId - (runId % Constants.MILLIS_ONE_DAY); return dayTimestamp; } else if (AggregationConstants.AGGREGATION_TYPE.WEEKLY.equals(aggTyp...
AppSummaryService { long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) { if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) { long dayTimestamp = runId - (runId % Constants.MILLIS_ONE_DAY); return dayTimestamp; } else if (AggregationConstants.AGGREGATION_TYPE.WEEKLY.equals(aggTyp...
AppSummaryService { long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) { if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) { long dayTimestamp = runId - (runId % Constants.MILLIS_ONE_DAY); return dayTimestamp; } else if (AggregationConstants.AGGREGATION_TYPE.WEEKLY.equals(aggTyp...
AppSummaryService { long getTimestamp(long runId, AggregationConstants.AGGREGATION_TYPE aggType) { if (AggregationConstants.AGGREGATION_TYPE.DAILY.equals(aggType)) { long dayTimestamp = runId - (runId % Constants.MILLIS_ONE_DAY); return dayTimestamp; } else if (AggregationConstants.AGGREGATION_TYPE.WEEKLY.equals(aggTyp...
@Test(expected = ProcessingException.class) public void testGetNumberRuns() throws IOException { Map<byte[], byte[]> r = new HashMap<byte[], byte[]>(); AppSummaryService appSummaryService = new AppSummaryService(hbaseConnection); assertEquals(0, appSummaryService.getNumberRunsScratch(r)); byte[] key = Bytes.toBytes("ab...
long getNumberRunsScratch(Map<byte[], byte[]> rawFamily) { long numberRuns = 0L; if (rawFamily != null) { numberRuns = rawFamily.size(); } if (numberRuns == 0L) { LOG.error("Number of runs in scratch column family can't be 0," + " if processing within TTL"); throw new ProcessingException("Number of runs is 0"); } retur...
AppSummaryService { long getNumberRunsScratch(Map<byte[], byte[]> rawFamily) { long numberRuns = 0L; if (rawFamily != null) { numberRuns = rawFamily.size(); } if (numberRuns == 0L) { LOG.error("Number of runs in scratch column family can't be 0," + " if processing within TTL"); throw new ProcessingException("Number of ...
AppSummaryService { long getNumberRunsScratch(Map<byte[], byte[]> rawFamily) { long numberRuns = 0L; if (rawFamily != null) { numberRuns = rawFamily.size(); } if (numberRuns == 0L) { LOG.error("Number of runs in scratch column family can't be 0," + " if processing within TTL"); throw new ProcessingException("Number of ...
AppSummaryService { long getNumberRunsScratch(Map<byte[], byte[]> rawFamily) { long numberRuns = 0L; if (rawFamily != null) { numberRuns = rawFamily.size(); } if (numberRuns == 0L) { LOG.error("Number of runs in scratch column family can't be 0," + " if processing within TTL"); throw new ProcessingException("Number of ...
AppSummaryService { long getNumberRunsScratch(Map<byte[], byte[]> rawFamily) { long numberRuns = 0L; if (rawFamily != null) { numberRuns = rawFamily.size(); } if (numberRuns == 0L) { LOG.error("Number of runs in scratch column family can't be 0," + " if processing within TTL"); throw new ProcessingException("Number of ...
@Test public void testCreateQueueListValue() throws IOException { JobDetails jd = new JobDetails(null); jd.setQueue("queue1"); byte[] qb = Bytes.toBytes("queue2!queue3!"); Cell existingQueuesCell = CellUtil.createCell(Bytes.toBytes("rowkey"), Constants.INFO_FAM_BYTES, Constants.HRAVEN_QUEUE_BYTES, HConstants.LATEST_TIM...
String createQueueListValue(JobDetails jobDetails, String existingQueues) { String queue = jobDetails.getQueue(); queue = queue.concat(Constants.SEP); if (existingQueues == null) { return queue; } if (!existingQueues.contains(queue)) { existingQueues = existingQueues.concat(queue); } return existingQueues; }
AppSummaryService { String createQueueListValue(JobDetails jobDetails, String existingQueues) { String queue = jobDetails.getQueue(); queue = queue.concat(Constants.SEP); if (existingQueues == null) { return queue; } if (!existingQueues.contains(queue)) { existingQueues = existingQueues.concat(queue); } return existing...
AppSummaryService { String createQueueListValue(JobDetails jobDetails, String existingQueues) { String queue = jobDetails.getQueue(); queue = queue.concat(Constants.SEP); if (existingQueues == null) { return queue; } if (!existingQueues.contains(queue)) { existingQueues = existingQueues.concat(queue); } return existing...
AppSummaryService { String createQueueListValue(JobDetails jobDetails, String existingQueues) { String queue = jobDetails.getQueue(); queue = queue.concat(Constants.SEP); if (existingQueues == null) { return queue; } if (!existingQueues.contains(queue)) { existingQueues = existingQueues.concat(queue); } return existing...
AppSummaryService { String createQueueListValue(JobDetails jobDetails, String existingQueues) { String queue = jobDetails.getQueue(); queue = queue.concat(Constants.SEP); if (existingQueues == null) { return queue; } if (!existingQueues.contains(queue)) { existingQueues = existingQueues.concat(queue); } return existing...
@Test public void testAddVersion() throws Exception { Configuration c = UTIL.getConfiguration(); String appId = "addVersion"; byte[] appIdBytes = Bytes.toBytes(appId); byte[] appRow = Bytes.add(Bytes.add(clusterBytes, Constants.SEP_BYTES), Bytes.add(userBytes, Constants.SEP_BYTES), appIdBytes); AppVersionService servic...
public boolean addVersion(String cluster, String user, String appId, String version, long timestamp) throws IOException { boolean updated = false; byte[] rowKey = getRowKey(cluster, user, appId); byte[] versionCol = Bytes.toBytes(version); int attempts = 0; int maxAttempts = 3; boolean checkForUpdate = true; while (che...
AppVersionService { public boolean addVersion(String cluster, String user, String appId, String version, long timestamp) throws IOException { boolean updated = false; byte[] rowKey = getRowKey(cluster, user, appId); byte[] versionCol = Bytes.toBytes(version); int attempts = 0; int maxAttempts = 3; boolean checkForUpdat...
AppVersionService { public boolean addVersion(String cluster, String user, String appId, String version, long timestamp) throws IOException { boolean updated = false; byte[] rowKey = getRowKey(cluster, user, appId); byte[] versionCol = Bytes.toBytes(version); int attempts = 0; int maxAttempts = 3; boolean checkForUpdat...
AppVersionService { public boolean addVersion(String cluster, String user, String appId, String version, long timestamp) throws IOException { boolean updated = false; byte[] rowKey = getRowKey(cluster, user, appId); byte[] versionCol = Bytes.toBytes(version); int attempts = 0; int maxAttempts = 3; boolean checkForUpdat...
AppVersionService { public boolean addVersion(String cluster, String user, String appId, String version, long timestamp) throws IOException { boolean updated = false; byte[] rowKey = getRowKey(cluster, user, appId); byte[] versionCol = Bytes.toBytes(version); int attempts = 0; int maxAttempts = 3; boolean checkForUpdat...
@Test public void testGetDistinctVersions() throws Exception { Configuration c = UTIL.getConfiguration(); { String appId = "getDistinctVersions"; AppVersionService service = null; service = new AppVersionService(hbaseConnection); List<VersionInfo> latest = service.getDistinctVersions(cluster, user, appId); assertEquals...
public List<VersionInfo> getDistinctVersions(String cluster, String user, String appId) throws IOException { Get get = new Get(getRowKey(cluster, user, appId)); List<VersionInfo> versions = Lists.newArrayList(); Long ts = 0L; Table versionsTable = null; try { versionsTable = hbaseConnection .getTable(TableName.valueOf(...
AppVersionService { public List<VersionInfo> getDistinctVersions(String cluster, String user, String appId) throws IOException { Get get = new Get(getRowKey(cluster, user, appId)); List<VersionInfo> versions = Lists.newArrayList(); Long ts = 0L; Table versionsTable = null; try { versionsTable = hbaseConnection .getTabl...
AppVersionService { public List<VersionInfo> getDistinctVersions(String cluster, String user, String appId) throws IOException { Get get = new Get(getRowKey(cluster, user, appId)); List<VersionInfo> versions = Lists.newArrayList(); Long ts = 0L; Table versionsTable = null; try { versionsTable = hbaseConnection .getTabl...
AppVersionService { public List<VersionInfo> getDistinctVersions(String cluster, String user, String appId) throws IOException { Get get = new Get(getRowKey(cluster, user, appId)); List<VersionInfo> versions = Lists.newArrayList(); Long ts = 0L; Table versionsTable = null; try { versionsTable = hbaseConnection .getTabl...
AppVersionService { public List<VersionInfo> getDistinctVersions(String cluster, String user, String appId) throws IOException { Get get = new Get(getRowKey(cluster, user, appId)); List<VersionInfo> versions = Lists.newArrayList(); Long ts = 0L; Table versionsTable = null; try { versionsTable = hbaseConnection .getTabl...
@Test(expected = IllegalArgumentException.class) public void testGetApproxSubmitTimeNull() throws IOException, MissingColumnInResultException { JobHistoryRawService rawService = new JobHistoryRawService(hbaseConnection); long st = rawService.getApproxSubmitTime(null); assertEquals(0L, st); }
public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, Constants.JOBHISTORY_LAST_MODIFIED_COL_BYTE...
JobHistoryRawService { public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, Constants.JOBHISTORY...
JobHistoryRawService { public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, Constants.JOBHISTORY...
JobHistoryRawService { public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, Constants.JOBHISTORY...
JobHistoryRawService { public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, Constants.JOBHISTORY...
@Test(expected = MissingColumnInResultException.class) public void testGetApproxSubmitTimeMissingCol() throws IOException, MissingColumnInResultException { JobHistoryRawService rawService = new JobHistoryRawService(hbaseConnection); Result result = new Result(); long st = rawService.getApproxSubmitTime(result); assertE...
public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, Constants.JOBHISTORY_LAST_MODIFIED_COL_BYTE...
JobHistoryRawService { public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, Constants.JOBHISTORY...
JobHistoryRawService { public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, Constants.JOBHISTORY...
JobHistoryRawService { public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, Constants.JOBHISTORY...
JobHistoryRawService { public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, Constants.JOBHISTORY...
@Test public void testGetApproxSubmitTime() throws IOException, MissingColumnInResultException { JobHistoryRawService rawService = new JobHistoryRawService(hbaseConnection); Cell[] cells = new Cell[1]; long modts = 1396550668000L; cells[0] = CellUtil.createCell(Bytes.toBytes("someRowKey"), Constants.INFO_FAM_BYTES, Con...
public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, Constants.JOBHISTORY_LAST_MODIFIED_COL_BYTE...
JobHistoryRawService { public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, Constants.JOBHISTORY...
JobHistoryRawService { public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, Constants.JOBHISTORY...
JobHistoryRawService { public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, Constants.JOBHISTORY...
JobHistoryRawService { public long getApproxSubmitTime(Result value) throws MissingColumnInResultException { if (value == null) { throw new IllegalArgumentException( "Cannot get last modification time from " + "a null hbase result"); } Cell cell = value.getColumnLatestCell(Constants.INFO_FAM_BYTES, Constants.JOBHISTORY...
@Test public void testConstructor1() throws Exception { QualifiedPathKey key1 = new QualifiedPathKey(cluster1, path1); testKeyComponents(key1); assertNull(key1.getNamespace()); }
public String getNamespace() { return namespace; }
QualifiedPathKey implements Comparable<Object> { public String getNamespace() { return namespace; } }
QualifiedPathKey implements Comparable<Object> { public String getNamespace() { return namespace; } QualifiedPathKey(String cluster, String path); QualifiedPathKey(String cluster, String path, String namespace); }
QualifiedPathKey implements Comparable<Object> { public String getNamespace() { return namespace; } QualifiedPathKey(String cluster, String path); QualifiedPathKey(String cluster, String path, String namespace); String getCluster(); String getPath(); String getNamespace(); @Override String toString(); @Override int co...
QualifiedPathKey implements Comparable<Object> { public String getNamespace() { return namespace; } QualifiedPathKey(String cluster, String path); QualifiedPathKey(String cluster, String path, String namespace); String getCluster(); String getPath(); String getNamespace(); @Override String toString(); @Override int co...
@Test public void testExtractXmxValue() { String jc = " -Xmx1024m -verbose:gc -Xloggc:/tmp/@taskid@.gc" ; String valStr = JobHistoryFileParserBase.extractXmxValueStr(jc); String expStr = "1024m"; assertEquals(expStr, valStr); }
static String extractXmxValueStr(String javaChildOptsStr) { if (StringUtils.isBlank(javaChildOptsStr)) { LOG.info("Null/empty input argument to get xmxValue, returning " + Constants.DEFAULT_XMX_SETTING_STR); return Constants.DEFAULT_XMX_SETTING_STR; } final String JAVA_XMX_PREFIX = "-Xmx"; String[] xmxStr = javaChildOp...
JobHistoryFileParserBase implements JobHistoryFileParser { static String extractXmxValueStr(String javaChildOptsStr) { if (StringUtils.isBlank(javaChildOptsStr)) { LOG.info("Null/empty input argument to get xmxValue, returning " + Constants.DEFAULT_XMX_SETTING_STR); return Constants.DEFAULT_XMX_SETTING_STR; } final Str...
JobHistoryFileParserBase implements JobHistoryFileParser { static String extractXmxValueStr(String javaChildOptsStr) { if (StringUtils.isBlank(javaChildOptsStr)) { LOG.info("Null/empty input argument to get xmxValue, returning " + Constants.DEFAULT_XMX_SETTING_STR); return Constants.DEFAULT_XMX_SETTING_STR; } final Str...
JobHistoryFileParserBase implements JobHistoryFileParser { static String extractXmxValueStr(String javaChildOptsStr) { if (StringUtils.isBlank(javaChildOptsStr)) { LOG.info("Null/empty input argument to get xmxValue, returning " + Constants.DEFAULT_XMX_SETTING_STR); return Constants.DEFAULT_XMX_SETTING_STR; } final Str...
JobHistoryFileParserBase implements JobHistoryFileParser { static String extractXmxValueStr(String javaChildOptsStr) { if (StringUtils.isBlank(javaChildOptsStr)) { LOG.info("Null/empty input argument to get xmxValue, returning " + Constants.DEFAULT_XMX_SETTING_STR); return Constants.DEFAULT_XMX_SETTING_STR; } final Str...
@Test public void testConstructor2() throws Exception { QualifiedPathKey key1 = new QualifiedPathKey(cluster1, path1, namespace1); testKeyComponents(key1); assertNotNull(key1.getNamespace()); assertEquals(key1.getNamespace(), namespace1); }
public String getNamespace() { return namespace; }
QualifiedPathKey implements Comparable<Object> { public String getNamespace() { return namespace; } }
QualifiedPathKey implements Comparable<Object> { public String getNamespace() { return namespace; } QualifiedPathKey(String cluster, String path); QualifiedPathKey(String cluster, String path, String namespace); }
QualifiedPathKey implements Comparable<Object> { public String getNamespace() { return namespace; } QualifiedPathKey(String cluster, String path); QualifiedPathKey(String cluster, String path, String namespace); String getCluster(); String getPath(); String getNamespace(); @Override String toString(); @Override int co...
QualifiedPathKey implements Comparable<Object> { public String getNamespace() { return namespace; } QualifiedPathKey(String cluster, String path); QualifiedPathKey(String cluster, String path, String namespace); String getCluster(); String getPath(); String getNamespace(); @Override String toString(); @Override int co...
@Test public void testInEqualityWithNamespace() throws Exception { QualifiedPathKey key1 = new QualifiedPathKey(cluster1, path1, namespace1); QualifiedPathKey key2 = new QualifiedPathKey(cluster1, path1, namespace2); assertEquals(key1.compareTo(key2), -1); }
@Override public int compareTo(Object other) { if (other == null) { return -1; } QualifiedPathKey otherKey = (QualifiedPathKey) other; if (StringUtils.isNotBlank(this.namespace)) { return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(getPath(), otherKey.getPath()) .append(this.namespace, o...
QualifiedPathKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } QualifiedPathKey otherKey = (QualifiedPathKey) other; if (StringUtils.isNotBlank(this.namespace)) { return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(getPath...
QualifiedPathKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } QualifiedPathKey otherKey = (QualifiedPathKey) other; if (StringUtils.isNotBlank(this.namespace)) { return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(getPath...
QualifiedPathKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } QualifiedPathKey otherKey = (QualifiedPathKey) other; if (StringUtils.isNotBlank(this.namespace)) { return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(getPath...
QualifiedPathKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } QualifiedPathKey otherKey = (QualifiedPathKey) other; if (StringUtils.isNotBlank(this.namespace)) { return new CompareToBuilder() .append(this.cluster, otherKey.getCluster()) .append(getPath...
@Test public void testNullHashCode() throws Exception { QualifiedPathKey key1 = new QualifiedPathKey(null, null); QualifiedPathKey key2 = new QualifiedPathKey(" ", " "); assertEquals(key1.hashCode(), key2.hashCode()); }
@Override public int hashCode() { return new HashCodeBuilder() .append(this.cluster) .append(this.path) .append(this.namespace) .toHashCode(); }
QualifiedPathKey implements Comparable<Object> { @Override public int hashCode() { return new HashCodeBuilder() .append(this.cluster) .append(this.path) .append(this.namespace) .toHashCode(); } }
QualifiedPathKey implements Comparable<Object> { @Override public int hashCode() { return new HashCodeBuilder() .append(this.cluster) .append(this.path) .append(this.namespace) .toHashCode(); } QualifiedPathKey(String cluster, String path); QualifiedPathKey(String cluster, String path, String namespace); }
QualifiedPathKey implements Comparable<Object> { @Override public int hashCode() { return new HashCodeBuilder() .append(this.cluster) .append(this.path) .append(this.namespace) .toHashCode(); } QualifiedPathKey(String cluster, String path); QualifiedPathKey(String cluster, String path, String namespace); String getClu...
QualifiedPathKey implements Comparable<Object> { @Override public int hashCode() { return new HashCodeBuilder() .append(this.cluster) .append(this.path) .append(this.namespace) .toHashCode(); } QualifiedPathKey(String cluster, String path); QualifiedPathKey(String cluster, String path, String namespace); String getClu...
@Test public void testKeySerialization() { JobKeyConverter conv = new JobKeyConverter(); JobKey key = new JobKey("cluster1@identifier1", "user1", "app1", 13, "job_20120101235959_0001"); byte[] keyBytes = conv.toBytes(key); JobKey key2 = conv.fromBytes(keyBytes); assertEquals(key.getCluster(), key2.getCluster()); assert...
public JobId getJobId() { return jobId; }
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } }
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } JobKey(String cluster, String userName, String appId, long runId, String jobId); @JsonCreator JobKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, ...
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } JobKey(String cluster, String userName, String appId, long runId, String jobId); @JsonCreator JobKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, ...
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } JobKey(String cluster, String userName, String appId, long runId, String jobId); @JsonCreator JobKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, ...
@Test public void testPlainConstructor() { JobKeyConverter conv = new JobKeyConverter(); JobKey key = new JobKey("cluster2@identifier2 ", "user2 ", "appSpace ", 17, " job_20120101235959_1111 "); byte[] keyBytes = conv.toBytes(key); JobKey key2 = conv.fromBytes(keyBytes); assertEquals(key.getUserName(), key2.getUserName...
public JobId getJobId() { return jobId; }
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } }
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } JobKey(String cluster, String userName, String appId, long runId, String jobId); @JsonCreator JobKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, ...
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } JobKey(String cluster, String userName, String appId, long runId, String jobId); @JsonCreator JobKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, ...
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } JobKey(String cluster, String userName, String appId, long runId, String jobId); @JsonCreator JobKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, ...
@Test public void testJobDescConstructor() { JobKeyConverter conv = new JobKeyConverter(); JobDesc jobDesc = new JobDesc("cluster2@identifier3 ", "user3 ", "appSpace ", "spaceVersion3 ", 19, " job_20120101235959_1111 ", Framework.NONE); JobKey key = new JobKey(jobDesc); byte[] keyBytes = conv.toBytes(key); JobKey key2 ...
public JobId getJobId() { return jobId; }
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } }
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } JobKey(String cluster, String userName, String appId, long runId, String jobId); @JsonCreator JobKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, ...
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } JobKey(String cluster, String userName, String appId, long runId, String jobId); @JsonCreator JobKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, ...
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } JobKey(String cluster, String userName, String appId, long runId, String jobId); @JsonCreator JobKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, ...
@Test public void testEncodedRunId() { JobKeyConverter conv = new JobKeyConverter(); long now = System.currentTimeMillis(); byte[] encoded = Bytes.toBytes(Long.MAX_VALUE - now); Bytes.putBytes(encoded, encoded.length-Constants.SEP_BYTES.length, Constants.SEP_BYTES, 0, Constants.SEP_BYTES.length); long badId = Long.MAX_...
public JobId getJobId() { return jobId; }
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } }
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } JobKey(String cluster, String userName, String appId, long runId, String jobId); @JsonCreator JobKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, ...
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } JobKey(String cluster, String userName, String appId, long runId, String jobId); @JsonCreator JobKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, ...
JobKey extends FlowKey implements Comparable<Object> { public JobId getJobId() { return jobId; } JobKey(String cluster, String userName, String appId, long runId, String jobId); @JsonCreator JobKey(@JsonProperty("cluster") String cluster, @JsonProperty("userName") String userName, ...
@Test public void testOrdering() { JobKey key1 = new JobKey("c1@local", "auser", "app", 1234L, "job_20120101000000_0001"); JobKey key2 = new JobKey("c1@local", "auser", "app", 1234L, "job_20120101000000_2222"); JobKey key3 = new JobKey("c1@local", "auser", "app", 1234L, "job_20120101000000_11111"); JobKey key4 = new Jo...
@Override public int compareTo(Object other) { if (other == null) { return -1; } JobKey otherKey = (JobKey)other; return new CompareToBuilder().appendSuper(super.compareTo(otherKey)) .append(this.jobId, otherKey.getJobId()) .toComparison(); }
JobKey extends FlowKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } JobKey otherKey = (JobKey)other; return new CompareToBuilder().appendSuper(super.compareTo(otherKey)) .append(this.jobId, otherKey.getJobId()) .toComparison(); } }
JobKey extends FlowKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } JobKey otherKey = (JobKey)other; return new CompareToBuilder().appendSuper(super.compareTo(otherKey)) .append(this.jobId, otherKey.getJobId()) .toComparison(); } JobKey(String cluster,...
JobKey extends FlowKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } JobKey otherKey = (JobKey)other; return new CompareToBuilder().appendSuper(super.compareTo(otherKey)) .append(this.jobId, otherKey.getJobId()) .toComparison(); } JobKey(String cluster,...
JobKey extends FlowKey implements Comparable<Object> { @Override public int compareTo(Object other) { if (other == null) { return -1; } JobKey otherKey = (JobKey)other; return new CompareToBuilder().appendSuper(super.compareTo(otherKey)) .append(this.jobId, otherKey.getJobId()) .toComparison(); } JobKey(String cluster,...
@Test public void testToString() { JobKey key = new JobKey("c1@local", "auser", "app", 1345L, "job_20120101000000_0001"); String expected = "c1@local" + Constants.SEP + "auser" + Constants.SEP + "app" + Constants.SEP + 1345L + Constants.SEP + "job_20120101000000_0001"; assertEquals(expected, key.toString()); }
public String toString() { return super.toString() + Constants.SEP + this.jobId.getJobIdString(); }
JobKey extends FlowKey implements Comparable<Object> { public String toString() { return super.toString() + Constants.SEP + this.jobId.getJobIdString(); } }
JobKey extends FlowKey implements Comparable<Object> { public String toString() { return super.toString() + Constants.SEP + this.jobId.getJobIdString(); } JobKey(String cluster, String userName, String appId, long runId, String jobId); @JsonCreator JobKey(@JsonProperty("cluster") String cluster, ...
JobKey extends FlowKey implements Comparable<Object> { public String toString() { return super.toString() + Constants.SEP + this.jobId.getJobIdString(); } JobKey(String cluster, String userName, String appId, long runId, String jobId); @JsonCreator JobKey(@JsonProperty("cluster") String cluster, ...
JobKey extends FlowKey implements Comparable<Object> { public String toString() { return super.toString() + Constants.SEP + this.jobId.getJobIdString(); } JobKey(String cluster, String userName, String appId, long runId, String jobId); @JsonCreator JobKey(@JsonProperty("cluster") String cluster, ...
@Test public void testExtractXmxValueIncorrectInput(){ String jc = " -Xmx" ; String valStr = JobHistoryFileParserBase.extractXmxValueStr(jc); String expStr = Constants.DEFAULT_XMX_SETTING_STR; assertEquals(expStr, valStr); }
static String extractXmxValueStr(String javaChildOptsStr) { if (StringUtils.isBlank(javaChildOptsStr)) { LOG.info("Null/empty input argument to get xmxValue, returning " + Constants.DEFAULT_XMX_SETTING_STR); return Constants.DEFAULT_XMX_SETTING_STR; } final String JAVA_XMX_PREFIX = "-Xmx"; String[] xmxStr = javaChildOp...
JobHistoryFileParserBase implements JobHistoryFileParser { static String extractXmxValueStr(String javaChildOptsStr) { if (StringUtils.isBlank(javaChildOptsStr)) { LOG.info("Null/empty input argument to get xmxValue, returning " + Constants.DEFAULT_XMX_SETTING_STR); return Constants.DEFAULT_XMX_SETTING_STR; } final Str...
JobHistoryFileParserBase implements JobHistoryFileParser { static String extractXmxValueStr(String javaChildOptsStr) { if (StringUtils.isBlank(javaChildOptsStr)) { LOG.info("Null/empty input argument to get xmxValue, returning " + Constants.DEFAULT_XMX_SETTING_STR); return Constants.DEFAULT_XMX_SETTING_STR; } final Str...
JobHistoryFileParserBase implements JobHistoryFileParser { static String extractXmxValueStr(String javaChildOptsStr) { if (StringUtils.isBlank(javaChildOptsStr)) { LOG.info("Null/empty input argument to get xmxValue, returning " + Constants.DEFAULT_XMX_SETTING_STR); return Constants.DEFAULT_XMX_SETTING_STR; } final Str...
JobHistoryFileParserBase implements JobHistoryFileParser { static String extractXmxValueStr(String javaChildOptsStr) { if (StringUtils.isBlank(javaChildOptsStr)) { LOG.info("Null/empty input argument to get xmxValue, returning " + Constants.DEFAULT_XMX_SETTING_STR); return Constants.DEFAULT_XMX_SETTING_STR; } final Str...
@Test public void testEnum() { PardResultSet r = PardResultSet.okResultSet; if (r.getStatus() == PardResultSet.ResultStatus.OK) { System.out.println("Y"); } else { System.out.println("N"); } }
public ResultStatus getStatus() { return resultStatus; }
PardResultSet implements Serializable { public ResultStatus getStatus() { return resultStatus; } }
PardResultSet implements Serializable { public ResultStatus getStatus() { return resultStatus; } PardResultSet(); PardResultSet(ResultStatus resultStatus); PardResultSet(ResultStatus resultStatus, String msg); PardResultSet(ResultStatus resultStatus, List<Column> schema); PardResultSet(ResultStatus resultStatus, Li...
PardResultSet implements Serializable { public ResultStatus getStatus() { return resultStatus; } PardResultSet(); PardResultSet(ResultStatus resultStatus); PardResultSet(ResultStatus resultStatus, String msg); PardResultSet(ResultStatus resultStatus, List<Column> schema); PardResultSet(ResultStatus resultStatus, Li...
PardResultSet implements Serializable { public ResultStatus getStatus() { return resultStatus; } PardResultSet(); PardResultSet(ResultStatus resultStatus); PardResultSet(ResultStatus resultStatus, String msg); PardResultSet(ResultStatus resultStatus, List<Column> schema); PardResultSet(ResultStatus resultStatus, Li...
@Test public void testSelectJoin() { String sql = "SELECT id, name FROM test0 JOIN test1 ON test0.id=test1.id where test0.id>10"; Statement statement = parser.createStatement(sql); System.out.println(statement.toString()); }
public Statement createStatement(String sql) { return (Statement) invokeParser("statement", sql, PardSqlBaseParser::singleStatement); }
SqlParser { public Statement createStatement(String sql) { return (Statement) invokeParser("statement", sql, PardSqlBaseParser::singleStatement); } }
SqlParser { public Statement createStatement(String sql) { return (Statement) invokeParser("statement", sql, PardSqlBaseParser::singleStatement); } }
SqlParser { public Statement createStatement(String sql) { return (Statement) invokeParser("statement", sql, PardSqlBaseParser::singleStatement); } Statement createStatement(String sql); Expression createExpression(String expression); }
SqlParser { public Statement createStatement(String sql) { return (Statement) invokeParser("statement", sql, PardSqlBaseParser::singleStatement); } Statement createStatement(String sql); Expression createExpression(String expression); }