target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void testLiteGettingStartedMediahubUA() throws IOException { String result = gs.detect(gs.mediaHubUserAgent); System.out.println("MediaHub User-Agent: " + gs.mediaHubUserAgent); System.out.println("IsMobile: " + result); assertTrue(result.equals("False")); }
public String detect(String userAgent) throws IOException { Match match = provider.match(userAgent); return match.getValues("IsMobile").toString(); }
GettingStarted implements Closeable { public String detect(String userAgent) throws IOException { Match match = provider.match(userAgent); return match.getValues("IsMobile").toString(); } }
GettingStarted implements Closeable { public String detect(String userAgent) throws IOException { Match match = provider.match(userAgent); return match.getValues("IsMobile").toString(); } GettingStarted(); }
GettingStarted implements Closeable { public String detect(String userAgent) throws IOException { Match match = provider.match(userAgent); return match.getValues("IsMobile").toString(); } GettingStarted(); String detect(String userAgent); static void main(String[] args); @Override void close(); }
GettingStarted implements Closeable { public String detect(String userAgent) throws IOException { Match match = provider.match(userAgent); return match.getValues("IsMobile").toString(); } GettingStarted(); String detect(String userAgent); static void main(String[] args); @Override void close(); }
@Test public void testProcessCsv() throws Exception { assertEquals(outputFile.length(), 0); example.processCsv(Shared.getGoodUserAgentsFile(), outputFile.getAbsolutePath()); assertNotEquals(outputFile.length(), 0); }
public void processCsv(String inputFileName, String outputFilename) throws IOException { BufferedReader bufferedReader = new BufferedReader(new FileReader(inputFileName)); try { FileWriter fileWriter = new FileWriter(outputFilename); try { Match match = provider.createMatch(); for (int i = 0; i < 20; i++) { String user...
OfflineProcessingExample implements Closeable { public void processCsv(String inputFileName, String outputFilename) throws IOException { BufferedReader bufferedReader = new BufferedReader(new FileReader(inputFileName)); try { FileWriter fileWriter = new FileWriter(outputFilename); try { Match match = provider.createMat...
OfflineProcessingExample implements Closeable { public void processCsv(String inputFileName, String outputFilename) throws IOException { BufferedReader bufferedReader = new BufferedReader(new FileReader(inputFileName)); try { FileWriter fileWriter = new FileWriter(outputFilename); try { Match match = provider.createMat...
OfflineProcessingExample implements Closeable { public void processCsv(String inputFileName, String outputFilename) throws IOException { BufferedReader bufferedReader = new BufferedReader(new FileReader(inputFileName)); try { FileWriter fileWriter = new FileWriter(outputFilename); try { Match match = provider.createMat...
OfflineProcessingExample implements Closeable { public void processCsv(String inputFileName, String outputFilename) throws IOException { BufferedReader bufferedReader = new BufferedReader(new FileReader(inputFileName)); try { FileWriter fileWriter = new FileWriter(outputFilename); try { Match match = provider.createMat...
@Test public void testLiteGettingStartedMobileUA() throws IOException { assertTrue(gs.isMobile(gs.mobileUserAgent)); }
public boolean isMobile(String userAgent) throws IOException { Match match = provider.match(userAgent); return match.getValues("IsMobile").toBool(); }
StronglyTypedValues implements Closeable { public boolean isMobile(String userAgent) throws IOException { Match match = provider.match(userAgent); return match.getValues("IsMobile").toBool(); } }
StronglyTypedValues implements Closeable { public boolean isMobile(String userAgent) throws IOException { Match match = provider.match(userAgent); return match.getValues("IsMobile").toBool(); } StronglyTypedValues(); }
StronglyTypedValues implements Closeable { public boolean isMobile(String userAgent) throws IOException { Match match = provider.match(userAgent); return match.getValues("IsMobile").toBool(); } StronglyTypedValues(); boolean isMobile(String userAgent); static void main(String[] args); @Override void close(); }
StronglyTypedValues implements Closeable { public boolean isMobile(String userAgent) throws IOException { Match match = provider.match(userAgent); return match.getValues("IsMobile").toBool(); } StronglyTypedValues(); boolean isMobile(String userAgent); static void main(String[] args); @Override void close(); }
@Test public void testLiteGettingStartedDesktopUA() throws IOException { assertFalse(gs.isMobile(gs.desktopUserAgent)); }
public boolean isMobile(String userAgent) throws IOException { Match match = provider.match(userAgent); return match.getValues("IsMobile").toBool(); }
StronglyTypedValues implements Closeable { public boolean isMobile(String userAgent) throws IOException { Match match = provider.match(userAgent); return match.getValues("IsMobile").toBool(); } }
StronglyTypedValues implements Closeable { public boolean isMobile(String userAgent) throws IOException { Match match = provider.match(userAgent); return match.getValues("IsMobile").toBool(); } StronglyTypedValues(); }
StronglyTypedValues implements Closeable { public boolean isMobile(String userAgent) throws IOException { Match match = provider.match(userAgent); return match.getValues("IsMobile").toBool(); } StronglyTypedValues(); boolean isMobile(String userAgent); static void main(String[] args); @Override void close(); }
StronglyTypedValues implements Closeable { public boolean isMobile(String userAgent) throws IOException { Match match = provider.match(userAgent); return match.getValues("IsMobile").toBool(); } StronglyTypedValues(); boolean isMobile(String userAgent); static void main(String[] args); @Override void close(); }
@Test public void testWrite() throws IOException { long length = 11111; long fileCount = 22222; long directoryCount = 33333; long quota = 44444; long spaceConsumed = 55555; long spaceQuota = 66666; ContentSummary contentSummary = new ContentSummary.Builder().length(length). fileCount(fileCount).directoryCount(directory...
@Override @InterfaceAudience.Private public void write(DataOutput out) throws IOException { out.writeLong(length); out.writeLong(fileCount); out.writeLong(directoryCount); out.writeLong(quota); out.writeLong(spaceConsumed); out.writeLong(spaceQuota); }
ContentSummary implements Writable { @Override @InterfaceAudience.Private public void write(DataOutput out) throws IOException { out.writeLong(length); out.writeLong(fileCount); out.writeLong(directoryCount); out.writeLong(quota); out.writeLong(spaceConsumed); out.writeLong(spaceQuota); } }
ContentSummary implements Writable { @Override @InterfaceAudience.Private public void write(DataOutput out) throws IOException { out.writeLong(length); out.writeLong(fileCount); out.writeLong(directoryCount); out.writeLong(quota); out.writeLong(spaceConsumed); out.writeLong(spaceQuota); } @Deprecated ContentSummary();...
ContentSummary implements Writable { @Override @InterfaceAudience.Private public void write(DataOutput out) throws IOException { out.writeLong(length); out.writeLong(fileCount); out.writeLong(directoryCount); out.writeLong(quota); out.writeLong(spaceConsumed); out.writeLong(spaceQuota); } @Deprecated ContentSummary();...
ContentSummary implements Writable { @Override @InterfaceAudience.Private public void write(DataOutput out) throws IOException { out.writeLong(length); out.writeLong(fileCount); out.writeLong(directoryCount); out.writeLong(quota); out.writeLong(spaceConsumed); out.writeLong(spaceQuota); } @Deprecated ContentSummary();...
@Test public void testReadFields() throws IOException { long length = 11111; long fileCount = 22222; long directoryCount = 33333; long quota = 44444; long spaceConsumed = 55555; long spaceQuota = 66666; ContentSummary contentSummary = new ContentSummary.Builder().build(); DataInput in = mock(DataInput.class); when(in.r...
@Override @InterfaceAudience.Private public void readFields(DataInput in) throws IOException { this.length = in.readLong(); this.fileCount = in.readLong(); this.directoryCount = in.readLong(); this.quota = in.readLong(); this.spaceConsumed = in.readLong(); this.spaceQuota = in.readLong(); }
ContentSummary implements Writable { @Override @InterfaceAudience.Private public void readFields(DataInput in) throws IOException { this.length = in.readLong(); this.fileCount = in.readLong(); this.directoryCount = in.readLong(); this.quota = in.readLong(); this.spaceConsumed = in.readLong(); this.spaceQuota = in.readL...
ContentSummary implements Writable { @Override @InterfaceAudience.Private public void readFields(DataInput in) throws IOException { this.length = in.readLong(); this.fileCount = in.readLong(); this.directoryCount = in.readLong(); this.quota = in.readLong(); this.spaceConsumed = in.readLong(); this.spaceQuota = in.readL...
ContentSummary implements Writable { @Override @InterfaceAudience.Private public void readFields(DataInput in) throws IOException { this.length = in.readLong(); this.fileCount = in.readLong(); this.directoryCount = in.readLong(); this.quota = in.readLong(); this.spaceConsumed = in.readLong(); this.spaceQuota = in.readL...
ContentSummary implements Writable { @Override @InterfaceAudience.Private public void readFields(DataInput in) throws IOException { this.length = in.readLong(); this.fileCount = in.readLong(); this.directoryCount = in.readLong(); this.quota = in.readLong(); this.spaceConsumed = in.readLong(); this.spaceQuota = in.readL...
@Test public void testGetHeaderWithQuota() { String header = " QUOTA REM_QUOTA SPACE_QUOTA " + "REM_SPACE_QUOTA DIR_COUNT FILE_COUNT CONTENT_SIZE "; assertEquals(header, ContentSummary.getHeader(true)); }
public static String getHeader(boolean qOption) { return qOption ? QUOTA_HEADER : HEADER; }
ContentSummary implements Writable { public static String getHeader(boolean qOption) { return qOption ? QUOTA_HEADER : HEADER; } }
ContentSummary implements Writable { public static String getHeader(boolean qOption) { return qOption ? QUOTA_HEADER : HEADER; } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCou...
ContentSummary implements Writable { public static String getHeader(boolean qOption) { return qOption ? QUOTA_HEADER : HEADER; } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCou...
ContentSummary implements Writable { public static String getHeader(boolean qOption) { return qOption ? QUOTA_HEADER : HEADER; } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCou...
@Test public void testGetHeaderNoQuota() { String header = " DIR_COUNT FILE_COUNT CONTENT_SIZE "; assertEquals(header, ContentSummary.getHeader(false)); }
public static String getHeader(boolean qOption) { return qOption ? QUOTA_HEADER : HEADER; }
ContentSummary implements Writable { public static String getHeader(boolean qOption) { return qOption ? QUOTA_HEADER : HEADER; } }
ContentSummary implements Writable { public static String getHeader(boolean qOption) { return qOption ? QUOTA_HEADER : HEADER; } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCou...
ContentSummary implements Writable { public static String getHeader(boolean qOption) { return qOption ? QUOTA_HEADER : HEADER; } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCou...
ContentSummary implements Writable { public static String getHeader(boolean qOption) { return qOption ? QUOTA_HEADER : HEADER; } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCou...
@Test public void testToStringWithQuota() { long length = 11111; long fileCount = 22222; long directoryCount = 33333; long quota = 44444; long spaceConsumed = 55555; long spaceQuota = 66665; ContentSummary contentSummary = new ContentSummary.Builder().length(length). fileCount(fileCount).directoryCount(directoryCount)....
@Override public String toString() { return toString(true); }
ContentSummary implements Writable { @Override public String toString() { return toString(true); } }
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
@Test public void testToStringNoQuota() { long length = 11111; long fileCount = 22222; long directoryCount = 33333; ContentSummary contentSummary = new ContentSummary.Builder().length(length). fileCount(fileCount).directoryCount(directoryCount).build(); String expected = " none inf none" + " inf 33333 22222 11111 "; as...
@Override public String toString() { return toString(true); }
ContentSummary implements Writable { @Override public String toString() { return toString(true); } }
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
@Test public void testToStringNoShowQuota() { long length = 11111; long fileCount = 22222; long directoryCount = 33333; long quota = 44444; long spaceConsumed = 55555; long spaceQuota = 66665; ContentSummary contentSummary = new ContentSummary.Builder().length(length). fileCount(fileCount).directoryCount(directoryCount...
@Override public String toString() { return toString(true); }
ContentSummary implements Writable { @Override public String toString() { return toString(true); } }
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
@Test public void testToString() { long length = 11111; long fileCount = 22222; long directoryCount = 33333; long quota = 44444; long spaceConsumed = 55555; long spaceQuota = 66665; ContentSummary contentSummary = new ContentSummary.Builder().length(length). fileCount(fileCount).directoryCount(directoryCount).quota(quo...
@Override public String toString() { return toString(true); }
ContentSummary implements Writable { @Override public String toString() { return toString(true); } }
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
@Test public void testToStringHumanWithQuota() { long length = Long.MAX_VALUE; long fileCount = 222222222; long directoryCount = 33333; long quota = 222256578; long spaceConsumed = 1073741825; long spaceQuota = 1; ContentSummary contentSummary = new ContentSummary.Builder().length(length). fileCount(fileCount).director...
@Override public String toString() { return toString(true); }
ContentSummary implements Writable { @Override public String toString() { return toString(true); } }
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
@Test public void testToStringHumanNoShowQuota() { long length = Long.MAX_VALUE; long fileCount = 222222222; long directoryCount = 33333; long quota = 222256578; long spaceConsumed = 55555; long spaceQuota = Long.MAX_VALUE; ContentSummary contentSummary = new ContentSummary.Builder().length(length). fileCount(fileCount...
@Override public String toString() { return toString(true); }
ContentSummary implements Writable { @Override public String toString() { return toString(true); } }
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
ContentSummary implements Writable { @Override public String toString() { return toString(true); } @Deprecated ContentSummary(); @Deprecated ContentSummary(long length, long fileCount, long directoryCount); @Deprecated ContentSummary( long length, long fileCount, long directoryCount, long quota, long spa...
@Test public void testLocatedBlocks2Locations() { DatanodeInfo d = DFSTestUtil.getLocalDatanodeInfo(); DatanodeInfo[] ds = new DatanodeInfo[1]; ds[0] = d; ExtendedBlock b1 = new ExtendedBlock("bpid", 1, 1, 1); LocatedBlock l1 = new LocatedBlock(b1, ds, 0, false); ExtendedBlock b2 = new ExtendedBlock("bpid", 2, 1, 1); L...
public static BlockLocation[] locatedBlocks2Locations(LocatedBlocks blocks) { if (blocks == null) { return new BlockLocation[0]; } return locatedBlocks2Locations(blocks.getLocatedBlocks()); }
DFSUtil { public static BlockLocation[] locatedBlocks2Locations(LocatedBlocks blocks) { if (blocks == null) { return new BlockLocation[0]; } return locatedBlocks2Locations(blocks.getLocatedBlocks()); } }
DFSUtil { public static BlockLocation[] locatedBlocks2Locations(LocatedBlocks blocks) { if (blocks == null) { return new BlockLocation[0]; } return locatedBlocks2Locations(blocks.getLocatedBlocks()); } private DFSUtil(); }
DFSUtil { public static BlockLocation[] locatedBlocks2Locations(LocatedBlocks blocks) { if (blocks == null) { return new BlockLocation[0]; } return locatedBlocks2Locations(blocks.getLocatedBlocks()); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom...
DFSUtil { public static BlockLocation[] locatedBlocks2Locations(LocatedBlocks blocks) { if (blocks == null) { return new BlockLocation[0]; } return locatedBlocks2Locations(blocks.getLocatedBlocks()); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom...
@Test public void getNameServiceId() { HdfsConfiguration conf = new HdfsConfiguration(); conf.set(DFS_NAMESERVICE_ID, "nn1"); assertEquals("nn1", DFSUtil.getNamenodeNameServiceId(conf)); }
private static String getNameServiceId(Configuration conf, String addressKey) { String nameserviceId = conf.get(DFS_NAMESERVICE_ID); if (nameserviceId != null) { return nameserviceId; } Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } String nnId = c...
DFSUtil { private static String getNameServiceId(Configuration conf, String addressKey) { String nameserviceId = conf.get(DFS_NAMESERVICE_ID); if (nameserviceId != null) { return nameserviceId; } Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } Strin...
DFSUtil { private static String getNameServiceId(Configuration conf, String addressKey) { String nameserviceId = conf.get(DFS_NAMESERVICE_ID); if (nameserviceId != null) { return nameserviceId; } Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } Strin...
DFSUtil { private static String getNameServiceId(Configuration conf, String addressKey) { String nameserviceId = conf.get(DFS_NAMESERVICE_ID); if (nameserviceId != null) { return nameserviceId; } Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } Strin...
DFSUtil { private static String getNameServiceId(Configuration conf, String addressKey) { String nameserviceId = conf.get(DFS_NAMESERVICE_ID); if (nameserviceId != null) { return nameserviceId; } Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } Strin...
@Test public void getNameNodeNameServiceId() { Configuration conf = setupAddress(DFS_NAMENODE_RPC_ADDRESS_KEY); assertEquals("nn1", DFSUtil.getNamenodeNameServiceId(conf)); }
public static String getNamenodeNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_RPC_ADDRESS_KEY); }
DFSUtil { public static String getNamenodeNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_RPC_ADDRESS_KEY); } }
DFSUtil { public static String getNamenodeNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_RPC_ADDRESS_KEY); } private DFSUtil(); }
DFSUtil { public static String getNamenodeNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_RPC_ADDRESS_KEY); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom getSecureRandom(); static T[] shuffle(final T[] array); stat...
DFSUtil { public static String getNamenodeNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_RPC_ADDRESS_KEY); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom getSecureRandom(); static T[] shuffle(final T[] array); stat...
@Test public void getBackupNameServiceId() { Configuration conf = setupAddress(DFS_NAMENODE_BACKUP_ADDRESS_KEY); assertEquals("nn1", DFSUtil.getBackupNameServiceId(conf)); }
public static String getBackupNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_BACKUP_ADDRESS_KEY); }
DFSUtil { public static String getBackupNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_BACKUP_ADDRESS_KEY); } }
DFSUtil { public static String getBackupNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_BACKUP_ADDRESS_KEY); } private DFSUtil(); }
DFSUtil { public static String getBackupNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_BACKUP_ADDRESS_KEY); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom getSecureRandom(); static T[] shuffle(final T[] array); sta...
DFSUtil { public static String getBackupNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_BACKUP_ADDRESS_KEY); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom getSecureRandom(); static T[] shuffle(final T[] array); sta...
@Test public void getSecondaryNameServiceId() { Configuration conf = setupAddress(DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY); assertEquals("nn1", DFSUtil.getSecondaryNameServiceId(conf)); }
public static String getSecondaryNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY); }
DFSUtil { public static String getSecondaryNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY); } }
DFSUtil { public static String getSecondaryNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY); } private DFSUtil(); }
DFSUtil { public static String getSecondaryNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom getSecureRandom(); static T[] shuffle(final T[] ...
DFSUtil { public static String getSecondaryNameServiceId(Configuration conf) { return getNameServiceId(conf, DFS_NAMENODE_SECONDARY_HTTP_ADDRESS_KEY); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom getSecureRandom(); static T[] shuffle(final T[] ...
@Test public void testGetNameServiceIds() { HdfsConfiguration conf = new HdfsConfiguration(); conf.set(DFS_NAMESERVICES, "nn1,nn2"); Collection<String> nameserviceIds = DFSUtil.getNameServiceIds(conf); Iterator<String> it = nameserviceIds.iterator(); assertEquals(2, nameserviceIds.size()); assertEquals("nn1", it.next()...
public static Collection<String> getNameServiceIds(Configuration conf) { return conf.getTrimmedStringCollection(DFS_NAMESERVICES); }
DFSUtil { public static Collection<String> getNameServiceIds(Configuration conf) { return conf.getTrimmedStringCollection(DFS_NAMESERVICES); } }
DFSUtil { public static Collection<String> getNameServiceIds(Configuration conf) { return conf.getTrimmedStringCollection(DFS_NAMESERVICES); } private DFSUtil(); }
DFSUtil { public static Collection<String> getNameServiceIds(Configuration conf) { return conf.getTrimmedStringCollection(DFS_NAMESERVICES); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom getSecureRandom(); static T[] shuffle(final T[] array); st...
DFSUtil { public static Collection<String> getNameServiceIds(Configuration conf) { return conf.getTrimmedStringCollection(DFS_NAMESERVICES); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom getSecureRandom(); static T[] shuffle(final T[] array); st...
@Test public void testGetOnlyNameServiceIdOrNull() { HdfsConfiguration conf = new HdfsConfiguration(); conf.set(DFS_NAMESERVICES, "ns1,ns2"); assertNull(DFSUtil.getOnlyNameServiceIdOrNull(conf)); conf.set(DFS_NAMESERVICES, ""); assertNull(DFSUtil.getOnlyNameServiceIdOrNull(conf)); conf.set(DFS_NAMESERVICES, "ns1"); ass...
public static String getOnlyNameServiceIdOrNull(Configuration conf) { Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } else { return null; } }
DFSUtil { public static String getOnlyNameServiceIdOrNull(Configuration conf) { Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } else { return null; } } }
DFSUtil { public static String getOnlyNameServiceIdOrNull(Configuration conf) { Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } else { return null; } } private DFSUtil(); }
DFSUtil { public static String getOnlyNameServiceIdOrNull(Configuration conf) { Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } else { return null; } } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom()...
DFSUtil { public static String getOnlyNameServiceIdOrNull(Configuration conf) { Collection<String> nsIds = getNameServiceIds(conf); if (1 == nsIds.size()) { return nsIds.toArray(new String[1])[0]; } else { return null; } } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom()...
@Test public void testDefaultNamenode() throws IOException { HdfsConfiguration conf = new HdfsConfiguration(); final String hdfs_default = "hdfs: conf.set(FS_DEFAULT_NAME_KEY, hdfs_default); Map<String, Map<String, InetSocketAddress>> addrMap = DFSUtil.getNNServiceRpcAddresses(conf); assertEquals(1, addrMap.size()); Ma...
public static Map<String, Map<String, InetSocketAddress>> getNNServiceRpcAddresses( Configuration conf) throws IOException { String defaultAddress; try { defaultAddress = NetUtils.getHostPortString(NameNode.getAddress(conf)); } catch (IllegalArgumentException e) { defaultAddress = null; } Map<String, Map<String, InetSo...
DFSUtil { public static Map<String, Map<String, InetSocketAddress>> getNNServiceRpcAddresses( Configuration conf) throws IOException { String defaultAddress; try { defaultAddress = NetUtils.getHostPortString(NameNode.getAddress(conf)); } catch (IllegalArgumentException e) { defaultAddress = null; } Map<String, Map<Stri...
DFSUtil { public static Map<String, Map<String, InetSocketAddress>> getNNServiceRpcAddresses( Configuration conf) throws IOException { String defaultAddress; try { defaultAddress = NetUtils.getHostPortString(NameNode.getAddress(conf)); } catch (IllegalArgumentException e) { defaultAddress = null; } Map<String, Map<Stri...
DFSUtil { public static Map<String, Map<String, InetSocketAddress>> getNNServiceRpcAddresses( Configuration conf) throws IOException { String defaultAddress; try { defaultAddress = NetUtils.getHostPortString(NameNode.getAddress(conf)); } catch (IllegalArgumentException e) { defaultAddress = null; } Map<String, Map<Stri...
DFSUtil { public static Map<String, Map<String, InetSocketAddress>> getNNServiceRpcAddresses( Configuration conf) throws IOException { String defaultAddress; try { defaultAddress = NetUtils.getHostPortString(NameNode.getAddress(conf)); } catch (IllegalArgumentException e) { defaultAddress = null; } Map<String, Map<Stri...
@Test public void testConfModificationFederationOnly() { final HdfsConfiguration conf = new HdfsConfiguration(); String nsId = "ns1"; conf.set(DFS_NAMESERVICES, nsId); conf.set(DFS_NAMESERVICE_ID, nsId); for (String key : NameNode.NAMENODE_SPECIFIC_KEYS) { conf.set(DFSUtil.addKeySuffixes(key, nsId), key); } NameNode.in...
public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); }
DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } }
DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } private DFSUtil(); }
DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom getSecureRandom(); static T[] shuffle(fi...
DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom getSecureRandom(); static T[] shuffle(fi...
@Test public void testConfModificationFederationAndHa() { final HdfsConfiguration conf = new HdfsConfiguration(); String nsId = "ns1"; String nnId = "nn1"; conf.set(DFS_NAMESERVICES, nsId); conf.set(DFS_NAMESERVICE_ID, nsId); conf.set(DFS_HA_NAMENODES_KEY_PREFIX + "." + nsId, nnId); for (String key : NameNode.NAMENODE_...
public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); }
DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } }
DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } private DFSUtil(); }
DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom getSecureRandom(); static T[] shuffle(fi...
DFSUtil { public static String addKeySuffixes(String key, String... suffixes) { String keySuffix = concatSuffixes(suffixes); return addSuffix(key, keySuffix); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom getSecureRandom(); static T[] shuffle(fi...
@Test public void testGetInfoServer() throws IOException, URISyntaxException { HdfsConfiguration conf = new HdfsConfiguration(); URI httpsport = DFSUtil.getInfoServer(null, conf, "https"); assertEquals(new URI("https", null, "0.0.0.0", DFS_NAMENODE_HTTPS_PORT_DEFAULT, null, null, null), httpsport); URI httpport = DFSUt...
public static URI getInfoServer(InetSocketAddress namenodeAddr, Configuration conf, String scheme) throws IOException { String[] suffixes = null; if (namenodeAddr != null) { suffixes = getSuffixIDs(conf, namenodeAddr, DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, DFSConfigKeys.DFS_NAMENODE_RPC_ADDRESS_KEY); } Str...
DFSUtil { public static URI getInfoServer(InetSocketAddress namenodeAddr, Configuration conf, String scheme) throws IOException { String[] suffixes = null; if (namenodeAddr != null) { suffixes = getSuffixIDs(conf, namenodeAddr, DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, DFSConfigKeys.DFS_NAMENODE_RPC_ADDRESS_K...
DFSUtil { public static URI getInfoServer(InetSocketAddress namenodeAddr, Configuration conf, String scheme) throws IOException { String[] suffixes = null; if (namenodeAddr != null) { suffixes = getSuffixIDs(conf, namenodeAddr, DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, DFSConfigKeys.DFS_NAMENODE_RPC_ADDRESS_K...
DFSUtil { public static URI getInfoServer(InetSocketAddress namenodeAddr, Configuration conf, String scheme) throws IOException { String[] suffixes = null; if (namenodeAddr != null) { suffixes = getSuffixIDs(conf, namenodeAddr, DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, DFSConfigKeys.DFS_NAMENODE_RPC_ADDRESS_K...
DFSUtil { public static URI getInfoServer(InetSocketAddress namenodeAddr, Configuration conf, String scheme) throws IOException { String[] suffixes = null; if (namenodeAddr != null) { suffixes = getSuffixIDs(conf, namenodeAddr, DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, DFSConfigKeys.DFS_NAMENODE_RPC_ADDRESS_K...
@Test public void getNameNodeServiceAddr() throws IOException { HdfsConfiguration conf = new HdfsConfiguration(); final String NS1_NN1_HOST = "ns1-nn1.example.com:8020"; final String NS1_NN1_HOST_SVC = "ns1-nn2.example.com:8021"; final String NS1_NN2_HOST = "ns1-nn1.example.com:8020"; final String NS1_NN2_HOST_SVC = "n...
public static String getNamenodeServiceAddr(final Configuration conf, String nsId, String nnId) { if (nsId == null) { nsId = getOnlyNameServiceIdOrNull(conf); } String serviceAddrKey = concatSuffixes( DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, nsId, nnId); String addrKey = concatSuffixes( DFSConfigKeys.DFS_NAM...
DFSUtil { public static String getNamenodeServiceAddr(final Configuration conf, String nsId, String nnId) { if (nsId == null) { nsId = getOnlyNameServiceIdOrNull(conf); } String serviceAddrKey = concatSuffixes( DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, nsId, nnId); String addrKey = concatSuffixes( DFSConfigKe...
DFSUtil { public static String getNamenodeServiceAddr(final Configuration conf, String nsId, String nnId) { if (nsId == null) { nsId = getOnlyNameServiceIdOrNull(conf); } String serviceAddrKey = concatSuffixes( DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, nsId, nnId); String addrKey = concatSuffixes( DFSConfigKe...
DFSUtil { public static String getNamenodeServiceAddr(final Configuration conf, String nsId, String nnId) { if (nsId == null) { nsId = getOnlyNameServiceIdOrNull(conf); } String serviceAddrKey = concatSuffixes( DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, nsId, nnId); String addrKey = concatSuffixes( DFSConfigKe...
DFSUtil { public static String getNamenodeServiceAddr(final Configuration conf, String nsId, String nnId) { if (nsId == null) { nsId = getOnlyNameServiceIdOrNull(conf); } String serviceAddrKey = concatSuffixes( DFSConfigKeys.DFS_NAMENODE_SERVICE_RPC_ADDRESS_KEY, nsId, nnId); String addrKey = concatSuffixes( DFSConfigKe...
@Test public void testGetHaNnHttpAddresses() throws IOException { final String LOGICAL_HOST_NAME = "ns1"; final String NS1_NN1_ADDR = "ns1-nn1.example.com:8020"; final String NS1_NN2_ADDR = "ns1-nn2.example.com:8020"; Configuration conf = createWebHDFSHAConfiguration(LOGICAL_HOST_NAME, NS1_NN1_ADDR, NS1_NN2_ADDR); Map<...
public static Map<String, Map<String, InetSocketAddress>> getHaNnWebHdfsAddresses( Configuration conf, String scheme) { if (WebHdfsFileSystem.SCHEME.equals(scheme)) { return getAddresses(conf, null, DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY); } else if (SWebHdfsFileSystem.SCHEME.equals(scheme)) { return getAddresses(...
DFSUtil { public static Map<String, Map<String, InetSocketAddress>> getHaNnWebHdfsAddresses( Configuration conf, String scheme) { if (WebHdfsFileSystem.SCHEME.equals(scheme)) { return getAddresses(conf, null, DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY); } else if (SWebHdfsFileSystem.SCHEME.equals(scheme)) { return get...
DFSUtil { public static Map<String, Map<String, InetSocketAddress>> getHaNnWebHdfsAddresses( Configuration conf, String scheme) { if (WebHdfsFileSystem.SCHEME.equals(scheme)) { return getAddresses(conf, null, DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY); } else if (SWebHdfsFileSystem.SCHEME.equals(scheme)) { return get...
DFSUtil { public static Map<String, Map<String, InetSocketAddress>> getHaNnWebHdfsAddresses( Configuration conf, String scheme) { if (WebHdfsFileSystem.SCHEME.equals(scheme)) { return getAddresses(conf, null, DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY); } else if (SWebHdfsFileSystem.SCHEME.equals(scheme)) { return get...
DFSUtil { public static Map<String, Map<String, InetSocketAddress>> getHaNnWebHdfsAddresses( Configuration conf, String scheme) { if (WebHdfsFileSystem.SCHEME.equals(scheme)) { return getAddresses(conf, null, DFSConfigKeys.DFS_NAMENODE_HTTP_ADDRESS_KEY); } else if (SWebHdfsFileSystem.SCHEME.equals(scheme)) { return get...
@Test public void testSubstituteForWildcardAddress() throws IOException { assertEquals("foo:12345", DFSUtil.substituteForWildcardAddress("0.0.0.0:12345", "foo")); assertEquals("127.0.0.1:12345", DFSUtil.substituteForWildcardAddress("127.0.0.1:12345", "foo")); }
@VisibleForTesting static String substituteForWildcardAddress(String configuredAddress, String defaultHost) throws IOException { InetSocketAddress sockAddr = NetUtils.createSocketAddr(configuredAddress); InetSocketAddress defaultSockAddr = NetUtils.createSocketAddr(defaultHost + ":0"); final InetAddress addr = sockAddr...
DFSUtil { @VisibleForTesting static String substituteForWildcardAddress(String configuredAddress, String defaultHost) throws IOException { InetSocketAddress sockAddr = NetUtils.createSocketAddr(configuredAddress); InetSocketAddress defaultSockAddr = NetUtils.createSocketAddr(defaultHost + ":0"); final InetAddress addr ...
DFSUtil { @VisibleForTesting static String substituteForWildcardAddress(String configuredAddress, String defaultHost) throws IOException { InetSocketAddress sockAddr = NetUtils.createSocketAddr(configuredAddress); InetSocketAddress defaultSockAddr = NetUtils.createSocketAddr(defaultHost + ":0"); final InetAddress addr ...
DFSUtil { @VisibleForTesting static String substituteForWildcardAddress(String configuredAddress, String defaultHost) throws IOException { InetSocketAddress sockAddr = NetUtils.createSocketAddr(configuredAddress); InetSocketAddress defaultSockAddr = NetUtils.createSocketAddr(defaultHost + ":0"); final InetAddress addr ...
DFSUtil { @VisibleForTesting static String substituteForWildcardAddress(String configuredAddress, String defaultHost) throws IOException { InetSocketAddress sockAddr = NetUtils.createSocketAddr(configuredAddress); InetSocketAddress defaultSockAddr = NetUtils.createSocketAddr(defaultHost + ":0"); final InetAddress addr ...
@Test (timeout=15000) public void testLocalhostReverseLookup() { Assume.assumeTrue(!Shell.WINDOWS); HdfsConfiguration conf = new HdfsConfiguration(); conf.set(CommonConfigurationKeys.FS_DEFAULT_NAME_KEY, "hdfs: Collection<URI> uris = DFSUtil.getNameServiceUris(conf); assertEquals(1, uris.size()); for (URI uri : uris) {...
public static Collection<URI> getNameServiceUris(Configuration conf, String... keys) { Set<URI> ret = new HashSet<URI>(); Set<URI> nonPreferredUris = new HashSet<URI>(); for (String nsId : getNameServiceIds(conf)) { if (HAUtil.isHAEnabled(conf, nsId)) { try { ret.add(new URI(HdfsConstants.HDFS_URI_SCHEME + ": } catch (...
DFSUtil { public static Collection<URI> getNameServiceUris(Configuration conf, String... keys) { Set<URI> ret = new HashSet<URI>(); Set<URI> nonPreferredUris = new HashSet<URI>(); for (String nsId : getNameServiceIds(conf)) { if (HAUtil.isHAEnabled(conf, nsId)) { try { ret.add(new URI(HdfsConstants.HDFS_URI_SCHEME + ":...
DFSUtil { public static Collection<URI> getNameServiceUris(Configuration conf, String... keys) { Set<URI> ret = new HashSet<URI>(); Set<URI> nonPreferredUris = new HashSet<URI>(); for (String nsId : getNameServiceIds(conf)) { if (HAUtil.isHAEnabled(conf, nsId)) { try { ret.add(new URI(HdfsConstants.HDFS_URI_SCHEME + ":...
DFSUtil { public static Collection<URI> getNameServiceUris(Configuration conf, String... keys) { Set<URI> ret = new HashSet<URI>(); Set<URI> nonPreferredUris = new HashSet<URI>(); for (String nsId : getNameServiceIds(conf)) { if (HAUtil.isHAEnabled(conf, nsId)) { try { ret.add(new URI(HdfsConstants.HDFS_URI_SCHEME + ":...
DFSUtil { public static Collection<URI> getNameServiceUris(Configuration conf, String... keys) { Set<URI> ret = new HashSet<URI>(); Set<URI> nonPreferredUris = new HashSet<URI>(); for (String nsId : getNameServiceIds(conf)) { if (HAUtil.isHAEnabled(conf, nsId)) { try { ret.add(new URI(HdfsConstants.HDFS_URI_SCHEME + ":...
@Test (timeout=15000) public void testIsValidName() { assertFalse(DFSUtil.isValidName("/foo/../bar")); assertFalse(DFSUtil.isValidName("/foo/./bar")); assertFalse(DFSUtil.isValidName("/foo assertTrue(DFSUtil.isValidName("/")); assertTrue(DFSUtil.isValidName("/bar/")); assertFalse(DFSUtil.isValidName("/foo/:/bar")); ass...
public static boolean isValidName(String src) { if (!src.startsWith(Path.SEPARATOR)) { return false; } String[] components = StringUtils.split(src, '/'); for (int i = 0; i < components.length; i++) { String element = components[i]; if (element.equals(".") || (element.indexOf(":") >= 0) || (element.indexOf("/") >= 0)) {...
DFSUtil { public static boolean isValidName(String src) { if (!src.startsWith(Path.SEPARATOR)) { return false; } String[] components = StringUtils.split(src, '/'); for (int i = 0; i < components.length; i++) { String element = components[i]; if (element.equals(".") || (element.indexOf(":") >= 0) || (element.indexOf("/"...
DFSUtil { public static boolean isValidName(String src) { if (!src.startsWith(Path.SEPARATOR)) { return false; } String[] components = StringUtils.split(src, '/'); for (int i = 0; i < components.length; i++) { String element = components[i]; if (element.equals(".") || (element.indexOf(":") >= 0) || (element.indexOf("/"...
DFSUtil { public static boolean isValidName(String src) { if (!src.startsWith(Path.SEPARATOR)) { return false; } String[] components = StringUtils.split(src, '/'); for (int i = 0; i < components.length; i++) { String element = components[i]; if (element.equals(".") || (element.indexOf(":") >= 0) || (element.indexOf("/"...
DFSUtil { public static boolean isValidName(String src) { if (!src.startsWith(Path.SEPARATOR)) { return false; } String[] components = StringUtils.split(src, '/'); for (int i = 0; i < components.length; i++) { String element = components[i]; if (element.equals(".") || (element.indexOf(":") >= 0) || (element.indexOf("/"...
@Test(timeout=5000) public void testGetSpnegoKeytabKey() { HdfsConfiguration conf = new HdfsConfiguration(); String defaultKey = "default.spengo.key"; conf.unset(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY); assertEquals("Test spnego key in config is null", defaultKey, DFSUtil.getSpnegoKeytabKey(conf, defa...
public static String getSpnegoKeytabKey(Configuration conf, String defaultKey) { String value = conf.get(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY); return (value == null || value.isEmpty()) ? defaultKey : DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY; }
DFSUtil { public static String getSpnegoKeytabKey(Configuration conf, String defaultKey) { String value = conf.get(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY); return (value == null || value.isEmpty()) ? defaultKey : DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY; } }
DFSUtil { public static String getSpnegoKeytabKey(Configuration conf, String defaultKey) { String value = conf.get(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY); return (value == null || value.isEmpty()) ? defaultKey : DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY; } private DFSUtil(); }
DFSUtil { public static String getSpnegoKeytabKey(Configuration conf, String defaultKey) { String value = conf.get(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY); return (value == null || value.isEmpty()) ? defaultKey : DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY; } private DFSUtil(); static in...
DFSUtil { public static String getSpnegoKeytabKey(Configuration conf, String defaultKey) { String value = conf.get(DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY); return (value == null || value.isEmpty()) ? defaultKey : DFSConfigKeys.DFS_WEB_AUTHENTICATION_KERBEROS_KEYTAB_KEY; } private DFSUtil(); static in...
@Test(timeout=1000) public void testDurationToString() throws Exception { assertEquals("000:00:00:00.000", DFSUtil.durationToString(0)); assertEquals("001:01:01:01.000", DFSUtil.durationToString(((24*60*60)+(60*60)+(60)+1)*1000)); assertEquals("000:23:59:59.999", DFSUtil.durationToString(((23*60*60)+(59*60)+(59))*1000+...
public static String durationToString(long durationMs) { boolean negative = false; if (durationMs < 0) { negative = true; durationMs = -durationMs; } long durationSec = durationMs / 1000; final int secondsPerMinute = 60; final int secondsPerHour = 60*60; final int secondsPerDay = 60*60*24; final long days = durationSec...
DFSUtil { public static String durationToString(long durationMs) { boolean negative = false; if (durationMs < 0) { negative = true; durationMs = -durationMs; } long durationSec = durationMs / 1000; final int secondsPerMinute = 60; final int secondsPerHour = 60*60; final int secondsPerDay = 60*60*24; final long days = d...
DFSUtil { public static String durationToString(long durationMs) { boolean negative = false; if (durationMs < 0) { negative = true; durationMs = -durationMs; } long durationSec = durationMs / 1000; final int secondsPerMinute = 60; final int secondsPerHour = 60*60; final int secondsPerDay = 60*60*24; final long days = d...
DFSUtil { public static String durationToString(long durationMs) { boolean negative = false; if (durationMs < 0) { negative = true; durationMs = -durationMs; } long durationSec = durationMs / 1000; final int secondsPerMinute = 60; final int secondsPerHour = 60*60; final int secondsPerDay = 60*60*24; final long days = d...
DFSUtil { public static String durationToString(long durationMs) { boolean negative = false; if (durationMs < 0) { negative = true; durationMs = -durationMs; } long durationSec = durationMs / 1000; final int secondsPerMinute = 60; final int secondsPerHour = 60*60; final int secondsPerDay = 60*60*24; final long days = d...
@Test(timeout=5000) public void testRelativeTimeConversion() throws Exception { try { DFSUtil.parseRelativeTime("1"); } catch (IOException e) { assertExceptionContains("too short", e); } try { DFSUtil.parseRelativeTime("1z"); } catch (IOException e) { assertExceptionContains("unknown time unit", e); } try { DFSUtil.par...
public static long parseRelativeTime(String relTime) throws IOException { if (relTime.length() < 2) { throw new IOException("Unable to parse relative time value of " + relTime + ": too short"); } String ttlString = relTime.substring(0, relTime.length()-1); long ttl; try { ttl = Long.parseLong(ttlString); } catch (Numbe...
DFSUtil { public static long parseRelativeTime(String relTime) throws IOException { if (relTime.length() < 2) { throw new IOException("Unable to parse relative time value of " + relTime + ": too short"); } String ttlString = relTime.substring(0, relTime.length()-1); long ttl; try { ttl = Long.parseLong(ttlString); } ca...
DFSUtil { public static long parseRelativeTime(String relTime) throws IOException { if (relTime.length() < 2) { throw new IOException("Unable to parse relative time value of " + relTime + ": too short"); } String ttlString = relTime.substring(0, relTime.length()-1); long ttl; try { ttl = Long.parseLong(ttlString); } ca...
DFSUtil { public static long parseRelativeTime(String relTime) throws IOException { if (relTime.length() < 2) { throw new IOException("Unable to parse relative time value of " + relTime + ": too short"); } String ttlString = relTime.substring(0, relTime.length()-1); long ttl; try { ttl = Long.parseLong(ttlString); } ca...
DFSUtil { public static long parseRelativeTime(String relTime) throws IOException { if (relTime.length() < 2) { throw new IOException("Unable to parse relative time value of " + relTime + ": too short"); } String ttlString = relTime.substring(0, relTime.length()-1); long ttl; try { ttl = Long.parseLong(ttlString); } ca...
@Test public void testAssertAllResultsEqual() { checkAllResults(new Long[]{}, true); checkAllResults(new Long[]{1l}, true); checkAllResults(new Long[]{1l, 1l}, true); checkAllResults(new Long[]{1l, 1l, 1l}, true); checkAllResults(new Long[]{new Long(1), new Long(1)}, true); checkAllResults(new Long[]{null, null, null},...
public static void assertAllResultsEqual(Collection<?> objects) throws AssertionError { if (objects.size() == 0 || objects.size() == 1) return; Object[] resultsArray = objects.toArray(); for (int i = 1; i < resultsArray.length; i++) { Object currElement = resultsArray[i]; Object lastElement = resultsArray[i - 1]; if ((...
DFSUtil { public static void assertAllResultsEqual(Collection<?> objects) throws AssertionError { if (objects.size() == 0 || objects.size() == 1) return; Object[] resultsArray = objects.toArray(); for (int i = 1; i < resultsArray.length; i++) { Object currElement = resultsArray[i]; Object lastElement = resultsArray[i -...
DFSUtil { public static void assertAllResultsEqual(Collection<?> objects) throws AssertionError { if (objects.size() == 0 || objects.size() == 1) return; Object[] resultsArray = objects.toArray(); for (int i = 1; i < resultsArray.length; i++) { Object currElement = resultsArray[i]; Object lastElement = resultsArray[i -...
DFSUtil { public static void assertAllResultsEqual(Collection<?> objects) throws AssertionError { if (objects.size() == 0 || objects.size() == 1) return; Object[] resultsArray = objects.toArray(); for (int i = 1; i < resultsArray.length; i++) { Object currElement = resultsArray[i]; Object lastElement = resultsArray[i -...
DFSUtil { public static void assertAllResultsEqual(Collection<?> objects) throws AssertionError { if (objects.size() == 0 || objects.size() == 1) return; Object[] resultsArray = objects.toArray(); for (int i = 1; i < resultsArray.length; i++) { Object currElement = resultsArray[i]; Object lastElement = resultsArray[i -...
@Test public void testGetPassword() throws Exception { File testDir = new File(System.getProperty("test.build.data", "target/test-dir")); Configuration conf = new Configuration(); final Path jksPath = new Path(testDir.toString(), "test.jks"); final String ourUrl = JavaKeyStoreProvider.SCHEME_NAME + ": File file = new F...
static String getPassword(Configuration conf, String alias) { String password = null; try { char[] passchars = conf.getPassword(alias); if (passchars != null) { password = new String(passchars); } } catch (IOException ioe) { password = null; } return password; }
DFSUtil { static String getPassword(Configuration conf, String alias) { String password = null; try { char[] passchars = conf.getPassword(alias); if (passchars != null) { password = new String(passchars); } } catch (IOException ioe) { password = null; } return password; } }
DFSUtil { static String getPassword(Configuration conf, String alias) { String password = null; try { char[] passchars = conf.getPassword(alias); if (passchars != null) { password = new String(passchars); } } catch (IOException ioe) { password = null; } return password; } private DFSUtil(); }
DFSUtil { static String getPassword(Configuration conf, String alias) { String password = null; try { char[] passchars = conf.getPassword(alias); if (passchars != null) { password = new String(passchars); } } catch (IOException ioe) { password = null; } return password; } private DFSUtil(); static int compareBytes(byt...
DFSUtil { static String getPassword(Configuration conf, String alias) { String password = null; try { char[] passchars = conf.getPassword(alias); if (passchars != null) { password = new String(passchars); } } catch (IOException ioe) { password = null; } return password; } private DFSUtil(); static int compareBytes(byt...
@Test public void testEncryptionProbe() throws Throwable { Configuration conf = new Configuration(false); conf.unset(DFSConfigKeys.DFS_ENCRYPTION_KEY_PROVIDER_URI); assertFalse("encryption enabled on no provider key", DFSUtil.isHDFSEncryptionEnabled(conf)); conf.set(DFSConfigKeys.DFS_ENCRYPTION_KEY_PROVIDER_URI, ""); a...
public static boolean isHDFSEncryptionEnabled(Configuration conf) { return !conf.getTrimmed( DFSConfigKeys.DFS_ENCRYPTION_KEY_PROVIDER_URI, "").isEmpty(); }
DFSUtil { public static boolean isHDFSEncryptionEnabled(Configuration conf) { return !conf.getTrimmed( DFSConfigKeys.DFS_ENCRYPTION_KEY_PROVIDER_URI, "").isEmpty(); } }
DFSUtil { public static boolean isHDFSEncryptionEnabled(Configuration conf) { return !conf.getTrimmed( DFSConfigKeys.DFS_ENCRYPTION_KEY_PROVIDER_URI, "").isEmpty(); } private DFSUtil(); }
DFSUtil { public static boolean isHDFSEncryptionEnabled(Configuration conf) { return !conf.getTrimmed( DFSConfigKeys.DFS_ENCRYPTION_KEY_PROVIDER_URI, "").isEmpty(); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom getSecureRandom(); static T[] shuf...
DFSUtil { public static boolean isHDFSEncryptionEnabled(Configuration conf) { return !conf.getTrimmed( DFSConfigKeys.DFS_ENCRYPTION_KEY_PROVIDER_URI, "").isEmpty(); } private DFSUtil(); static int compareBytes(byte[] left, byte[] right); static Random getRandom(); static SecureRandom getSecureRandom(); static T[] shuf...
@Test public void testGetInvalidateBlocks() throws Exception { final int MAX_BLOCKS = 10; final int REMAINING_BLOCKS = 2; final int MAX_LIMIT = MAX_BLOCKS - REMAINING_BLOCKS; DatanodeDescriptor dd = DFSTestUtil.getLocalDatanodeDescriptor(); ArrayList<Block> blockList = new ArrayList<Block>(MAX_BLOCKS); for (int i=0; i<...
public Block[] getInvalidateBlocks(int maxblocks) { synchronized (invalidateBlocks) { Block[] deleteList = invalidateBlocks.pollToArray(new Block[Math.min( invalidateBlocks.size(), maxblocks)]); return deleteList.length == 0 ? null : deleteList; } }
DatanodeDescriptor extends DatanodeInfo { public Block[] getInvalidateBlocks(int maxblocks) { synchronized (invalidateBlocks) { Block[] deleteList = invalidateBlocks.pollToArray(new Block[Math.min( invalidateBlocks.size(), maxblocks)]); return deleteList.length == 0 ? null : deleteList; } } }
DatanodeDescriptor extends DatanodeInfo { public Block[] getInvalidateBlocks(int maxblocks) { synchronized (invalidateBlocks) { Block[] deleteList = invalidateBlocks.pollToArray(new Block[Math.min( invalidateBlocks.size(), maxblocks)]); return deleteList.length == 0 ? null : deleteList; } } DatanodeDescriptor(DatanodeI...
DatanodeDescriptor extends DatanodeInfo { public Block[] getInvalidateBlocks(int maxblocks) { synchronized (invalidateBlocks) { Block[] deleteList = invalidateBlocks.pollToArray(new Block[Math.min( invalidateBlocks.size(), maxblocks)]); return deleteList.length == 0 ? null : deleteList; } } DatanodeDescriptor(DatanodeI...
DatanodeDescriptor extends DatanodeInfo { public Block[] getInvalidateBlocks(int maxblocks) { synchronized (invalidateBlocks) { Block[] deleteList = invalidateBlocks.pollToArray(new Block[Math.min( invalidateBlocks.size(), maxblocks)]); return deleteList.length == 0 ? null : deleteList; } } DatanodeDescriptor(DatanodeI...
@Test public void testSetEnvFromInputString() { Map<String, String> environment = new HashMap<String, String>(); environment.put("JAVA_HOME", "/path/jdk"); String goodEnv = "a1=1,b_2=2,_c=3,d=4,e=,f_win=%JAVA_HOME%" + ",g_nix=$JAVA_HOME"; Apps.setEnvFromInputString(environment, goodEnv, File.pathSeparator); assertEqual...
public static void setEnvFromInputString(Map<String, String> env, String envString, String classPathSeparator) { if (envString != null && envString.length() > 0) { Matcher varValMatcher = VARVAL_SPLITTER.matcher(envString); while (varValMatcher.find()) { String envVar = varValMatcher.group(1); String envVal = varValMat...
Apps { public static void setEnvFromInputString(Map<String, String> env, String envString, String classPathSeparator) { if (envString != null && envString.length() > 0) { Matcher varValMatcher = VARVAL_SPLITTER.matcher(envString); while (varValMatcher.find()) { String envVar = varValMatcher.group(1); String envVal = va...
Apps { public static void setEnvFromInputString(Map<String, String> env, String envString, String classPathSeparator) { if (envString != null && envString.length() > 0) { Matcher varValMatcher = VARVAL_SPLITTER.matcher(envString); while (varValMatcher.find()) { String envVar = varValMatcher.group(1); String envVal = va...
Apps { public static void setEnvFromInputString(Map<String, String> env, String envString, String classPathSeparator) { if (envString != null && envString.length() > 0) { Matcher varValMatcher = VARVAL_SPLITTER.matcher(envString); while (varValMatcher.find()) { String envVar = varValMatcher.group(1); String envVal = va...
Apps { public static void setEnvFromInputString(Map<String, String> env, String envString, String classPathSeparator) { if (envString != null && envString.length() > 0) { Matcher varValMatcher = VARVAL_SPLITTER.matcher(envString); while (varValMatcher.find()) { String envVar = varValMatcher.group(1); String envVal = va...
@Test public void testSetEnvFromInputStringWithQuotes() { Map<String, String> environment = new HashMap<String, String>(); String envString = "YARN_CONTAINER_RUNTIME_TYPE=docker" + ",YARN_CONTAINER_RUNTIME_DOCKER_IMAGE=hadoop-docker" + ",YARN_CONTAINER_RUNTIME_DOCKER_LOCAL_RESOURCE_MOUNTS=\"/dir1:/targetdir1,/dir2:/tar...
public static void setEnvFromInputString(Map<String, String> env, String envString, String classPathSeparator) { if (envString != null && envString.length() > 0) { Matcher varValMatcher = VARVAL_SPLITTER.matcher(envString); while (varValMatcher.find()) { String envVar = varValMatcher.group(1); String envVal = varValMat...
Apps { public static void setEnvFromInputString(Map<String, String> env, String envString, String classPathSeparator) { if (envString != null && envString.length() > 0) { Matcher varValMatcher = VARVAL_SPLITTER.matcher(envString); while (varValMatcher.find()) { String envVar = varValMatcher.group(1); String envVal = va...
Apps { public static void setEnvFromInputString(Map<String, String> env, String envString, String classPathSeparator) { if (envString != null && envString.length() > 0) { Matcher varValMatcher = VARVAL_SPLITTER.matcher(envString); while (varValMatcher.find()) { String envVar = varValMatcher.group(1); String envVal = va...
Apps { public static void setEnvFromInputString(Map<String, String> env, String envString, String classPathSeparator) { if (envString != null && envString.length() > 0) { Matcher varValMatcher = VARVAL_SPLITTER.matcher(envString); while (varValMatcher.find()) { String envVar = varValMatcher.group(1); String envVal = va...
Apps { public static void setEnvFromInputString(Map<String, String> env, String envString, String classPathSeparator) { if (envString != null && envString.length() > 0) { Matcher varValMatcher = VARVAL_SPLITTER.matcher(envString); while (varValMatcher.find()) { String envVar = varValMatcher.group(1); String envVal = va...
@Test(timeout = 5000) public void testAddInvalidlabel() throws IOException { boolean caught = false; try { Set<String> set = new HashSet<String>(); set.add(null); mgr.addToCluserNodeLabels(set); } catch (IOException e) { caught = true; } Assert.assertTrue("null label should not add to repo", caught); caught = false; tr...
@SuppressWarnings("unchecked") public void addToCluserNodeLabels(Set<String> labels) throws IOException { if (!nodeLabelsEnabled) { LOG.error(NODE_LABELS_NOT_ENABLED_ERR); throw new IOException(NODE_LABELS_NOT_ENABLED_ERR); } if (null == labels || labels.isEmpty()) { return; } Set<String> newLabels = new HashSet<String...
CommonNodeLabelsManager extends AbstractService { @SuppressWarnings("unchecked") public void addToCluserNodeLabels(Set<String> labels) throws IOException { if (!nodeLabelsEnabled) { LOG.error(NODE_LABELS_NOT_ENABLED_ERR); throw new IOException(NODE_LABELS_NOT_ENABLED_ERR); } if (null == labels || labels.isEmpty()) { re...
CommonNodeLabelsManager extends AbstractService { @SuppressWarnings("unchecked") public void addToCluserNodeLabels(Set<String> labels) throws IOException { if (!nodeLabelsEnabled) { LOG.error(NODE_LABELS_NOT_ENABLED_ERR); throw new IOException(NODE_LABELS_NOT_ENABLED_ERR); } if (null == labels || labels.isEmpty()) { re...
CommonNodeLabelsManager extends AbstractService { @SuppressWarnings("unchecked") public void addToCluserNodeLabels(Set<String> labels) throws IOException { if (!nodeLabelsEnabled) { LOG.error(NODE_LABELS_NOT_ENABLED_ERR); throw new IOException(NODE_LABELS_NOT_ENABLED_ERR); } if (null == labels || labels.isEmpty()) { re...
CommonNodeLabelsManager extends AbstractService { @SuppressWarnings("unchecked") public void addToCluserNodeLabels(Set<String> labels) throws IOException { if (!nodeLabelsEnabled) { LOG.error(NODE_LABELS_NOT_ENABLED_ERR); throw new IOException(NODE_LABELS_NOT_ENABLED_ERR); } if (null == labels || labels.isEmpty()) { re...
@Test public void testNonSecureRunAsSubmitter() throws Exception { Assume.assumeTrue(shouldRun()); Assume.assumeFalse(UserGroupInformation.isSecurityEnabled()); String expectedRunAsUser = appSubmitter; conf.set(YarnConfiguration.NM_NONSECURE_MODE_LIMIT_USERS, "false"); exec.setConf(conf); File touchFile = new File(work...
@Override public void setConf(Configuration conf) { super.setConf(conf); resourcesHandler = ReflectionUtils.newInstance( conf.getClass(YarnConfiguration.NM_LINUX_CONTAINER_RESOURCES_HANDLER, DefaultLCEResourcesHandler.class, LCEResourcesHandler.class), conf); resourcesHandler.setConf(conf); if (conf.get(YarnConfigurati...
LinuxContainerExecutor extends ContainerExecutor { @Override public void setConf(Configuration conf) { super.setConf(conf); resourcesHandler = ReflectionUtils.newInstance( conf.getClass(YarnConfiguration.NM_LINUX_CONTAINER_RESOURCES_HANDLER, DefaultLCEResourcesHandler.class, LCEResourcesHandler.class), conf); resources...
LinuxContainerExecutor extends ContainerExecutor { @Override public void setConf(Configuration conf) { super.setConf(conf); resourcesHandler = ReflectionUtils.newInstance( conf.getClass(YarnConfiguration.NM_LINUX_CONTAINER_RESOURCES_HANDLER, DefaultLCEResourcesHandler.class, LCEResourcesHandler.class), conf); resources...
LinuxContainerExecutor extends ContainerExecutor { @Override public void setConf(Configuration conf) { super.setConf(conf); resourcesHandler = ReflectionUtils.newInstance( conf.getClass(YarnConfiguration.NM_LINUX_CONTAINER_RESOURCES_HANDLER, DefaultLCEResourcesHandler.class, LCEResourcesHandler.class), conf); resources...
LinuxContainerExecutor extends ContainerExecutor { @Override public void setConf(Configuration conf) { super.setConf(conf); resourcesHandler = ReflectionUtils.newInstance( conf.getClass(YarnConfiguration.NM_LINUX_CONTAINER_RESOURCES_HANDLER, DefaultLCEResourcesHandler.class, LCEResourcesHandler.class), conf); resources...
@Test public void testContainerKill() throws Exception { Assume.assumeTrue(shouldRun()); final ContainerId sleepId = getNextContainerId(); Thread t = new Thread() { public void run() { try { runAndBlock(sleepId, "sleep", "100"); } catch (IOException e) { LOG.warn("Caught exception while running sleep", e); } }; }; t.se...
@Override public boolean signalContainer(ContainerSignalContext ctx) throws IOException { Container container = ctx.getContainer(); String user = ctx.getUser(); String pid = ctx.getPid(); Signal signal = ctx.getSignal(); verifyUsernamePattern(user); String runAsUser = getRunAsUser(user); ContainerRuntimeContext runtime...
LinuxContainerExecutor extends ContainerExecutor { @Override public boolean signalContainer(ContainerSignalContext ctx) throws IOException { Container container = ctx.getContainer(); String user = ctx.getUser(); String pid = ctx.getPid(); Signal signal = ctx.getSignal(); verifyUsernamePattern(user); String runAsUser = ...
LinuxContainerExecutor extends ContainerExecutor { @Override public boolean signalContainer(ContainerSignalContext ctx) throws IOException { Container container = ctx.getContainer(); String user = ctx.getUser(); String pid = ctx.getPid(); Signal signal = ctx.getSignal(); verifyUsernamePattern(user); String runAsUser = ...
LinuxContainerExecutor extends ContainerExecutor { @Override public boolean signalContainer(ContainerSignalContext ctx) throws IOException { Container container = ctx.getContainer(); String user = ctx.getUser(); String pid = ctx.getPid(); Signal signal = ctx.getSignal(); verifyUsernamePattern(user); String runAsUser = ...
LinuxContainerExecutor extends ContainerExecutor { @Override public boolean signalContainer(ContainerSignalContext ctx) throws IOException { Container container = ctx.getContainer(); String user = ctx.getUser(); String pid = ctx.getPid(); Signal signal = ctx.getSignal(); verifyUsernamePattern(user); String runAsUser = ...
@Test public void testCGroups() throws Exception { Assume.assumeTrue(shouldRun()); String cgroupsMount = System.getProperty("cgroups.mount"); Assume.assumeTrue((cgroupsMount != null) && !cgroupsMount.isEmpty()); assertTrue("Cgroups mount point does not exist", new File( cgroupsMount).exists()); List<String> cgroupKVs =...
public void mountCgroups(List<String> cgroupKVs, String hierarchy) throws IOException { try { PrivilegedOperation mountCGroupsOp = new PrivilegedOperation( PrivilegedOperation.OperationType.MOUNT_CGROUPS, hierarchy); Configuration conf = super.getConf(); mountCGroupsOp.appendArgs(cgroupKVs); PrivilegedOperationExecutor...
LinuxContainerExecutor extends ContainerExecutor { public void mountCgroups(List<String> cgroupKVs, String hierarchy) throws IOException { try { PrivilegedOperation mountCGroupsOp = new PrivilegedOperation( PrivilegedOperation.OperationType.MOUNT_CGROUPS, hierarchy); Configuration conf = super.getConf(); mountCGroupsOp...
LinuxContainerExecutor extends ContainerExecutor { public void mountCgroups(List<String> cgroupKVs, String hierarchy) throws IOException { try { PrivilegedOperation mountCGroupsOp = new PrivilegedOperation( PrivilegedOperation.OperationType.MOUNT_CGROUPS, hierarchy); Configuration conf = super.getConf(); mountCGroupsOp...
LinuxContainerExecutor extends ContainerExecutor { public void mountCgroups(List<String> cgroupKVs, String hierarchy) throws IOException { try { PrivilegedOperation mountCGroupsOp = new PrivilegedOperation( PrivilegedOperation.OperationType.MOUNT_CGROUPS, hierarchy); Configuration conf = super.getConf(); mountCGroupsOp...
LinuxContainerExecutor extends ContainerExecutor { public void mountCgroups(List<String> cgroupKVs, String hierarchy) throws IOException { try { PrivilegedOperation mountCGroupsOp = new PrivilegedOperation( PrivilegedOperation.OperationType.MOUNT_CGROUPS, hierarchy); Configuration conf = super.getConf(); mountCGroupsOp...
@Test (timeout = 5000) public void testRunCommandNoPriority() throws Exception { Configuration conf = new Configuration(); String[] command = containerExecutor.getRunCommand("echo", "group1", "user", null, conf); assertTrue("first command should be the run command for the platform", command[0].equals(Shell.WINUTILS) ||...
protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); }
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } }
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } }
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } @Override void setConf(Configuration conf); @Override Configuration getConf(); abstr...
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } @Override void setConf(Configuration conf); @Override Configuration getConf(); abstr...
@Test (timeout = 5000) public void testRunCommandwithPriority() throws Exception { Configuration conf = new Configuration(); conf.setInt(YarnConfiguration.NM_CONTAINER_EXECUTOR_SCHED_PRIORITY, 2); String[] command = containerExecutor.getRunCommand("echo", "group1", "user", null, conf); if (Shell.WINDOWS) { assertEquals...
protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); }
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } }
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } }
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } @Override void setConf(Configuration conf); @Override Configuration getConf(); abstr...
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } @Override void setConf(Configuration conf); @Override Configuration getConf(); abstr...
@Test (timeout = 5000) public void testRunCommandWithNoResources() { assumeTrue(Shell.WINDOWS); Configuration conf = new Configuration(); String[] command = containerExecutor.getRunCommand("echo", "group1", null, null, conf, Resource.newInstance(1024, 1)); String[] expected = { Shell.WINUTILS, "task", "create", "-m", "...
protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); }
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } }
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } }
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } @Override void setConf(Configuration conf); @Override Configuration getConf(); abstr...
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } @Override void setConf(Configuration conf); @Override Configuration getConf(); abstr...
@Test (timeout = 5000) public void testRunCommandWithMemoryOnlyResources() { assumeTrue(Shell.WINDOWS); Configuration conf = new Configuration(); conf.set(YarnConfiguration.NM_WINDOWS_CONTAINER_MEMORY_LIMIT_ENABLED, "true"); String[] command = containerExecutor.getRunCommand("echo", "group1", null, null, conf, Resource...
protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); }
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } }
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } }
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } @Override void setConf(Configuration conf); @Override Configuration getConf(); abstr...
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } @Override void setConf(Configuration conf); @Override Configuration getConf(); abstr...
@Test (timeout = 5000) public void testRunCommandWithCpuAndMemoryResources() { assumeTrue(Shell.WINDOWS); Configuration conf = new Configuration(); conf.set(YarnConfiguration.NM_WINDOWS_CONTAINER_CPU_LIMIT_ENABLED, "true"); conf.set(YarnConfiguration.NM_WINDOWS_CONTAINER_MEMORY_LIMIT_ENABLED, "true"); String[] command ...
protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); }
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } }
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } }
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } @Override void setConf(Configuration conf); @Override Configuration getConf(); abstr...
ContainerExecutor implements Configurable { protected String[] getRunCommand(String command, String groupId, String userName, Path pidFile, Configuration conf) { return getRunCommand(command, groupId, userName, pidFile, conf, null); } @Override void setConf(Configuration conf); @Override Configuration getConf(); abstr...
@Test public void testCreateDirectories() throws IOException { conf.set(CommonConfigurationKeys.FS_PERMISSIONS_UMASK_KEY, "077"); String dirA = new File(testDir, "dirA").getPath(); String dirB = new File(dirA, "dirB").getPath(); String dirC = new File(testDir, "dirC").getPath(); Path pathC = new Path(dirC); FsPermissio...
synchronized boolean createNonExistentDirs(FileContext localFs, FsPermission perm) { boolean failed = false; for (final String dir : localDirs) { try { createDir(localFs, new Path(dir), perm); } catch (IOException e) { LOG.warn("Unable to create directory " + dir + " error " + e.getMessage() + ", removing from the list...
DirectoryCollection { synchronized boolean createNonExistentDirs(FileContext localFs, FsPermission perm) { boolean failed = false; for (final String dir : localDirs) { try { createDir(localFs, new Path(dir), perm); } catch (IOException e) { LOG.warn("Unable to create directory " + dir + " error " + e.getMessage() + ", ...
DirectoryCollection { synchronized boolean createNonExistentDirs(FileContext localFs, FsPermission perm) { boolean failed = false; for (final String dir : localDirs) { try { createDir(localFs, new Path(dir), perm); } catch (IOException e) { LOG.warn("Unable to create directory " + dir + " error " + e.getMessage() + ", ...
DirectoryCollection { synchronized boolean createNonExistentDirs(FileContext localFs, FsPermission perm) { boolean failed = false; for (final String dir : localDirs) { try { createDir(localFs, new Path(dir), perm); } catch (IOException e) { LOG.warn("Unable to create directory " + dir + " error " + e.getMessage() + ", ...
DirectoryCollection { synchronized boolean createNonExistentDirs(FileContext localFs, FsPermission perm) { boolean failed = false; for (final String dir : localDirs) { try { createDir(localFs, new Path(dir), perm); } catch (IOException e) { LOG.warn("Unable to create directory " + dir + " error " + e.getMessage() + ", ...
@Test public void testLaunchContainer() throws IOException { if (!shouldRun()) { LOG.warn("Docker not installed, aborting test."); return; } Map<String, String> env = new HashMap<String, String>(); env.put(YarnConfiguration.NM_DOCKER_CONTAINER_EXECUTOR_IMAGE_NAME, testImage); String touchFileName = "touch-file-" + Syst...
@Override public int launchContainer(ContainerStartContext ctx) throws IOException { Container container = ctx.getContainer(); Path nmPrivateContainerScriptPath = ctx.getNmPrivateContainerScriptPath(); Path nmPrivateTokensPath = ctx.getNmPrivateTokensPath(); String userName = ctx.getUser(); Path containerWorkDir = ctx....
DockerContainerExecutor extends ContainerExecutor { @Override public int launchContainer(ContainerStartContext ctx) throws IOException { Container container = ctx.getContainer(); Path nmPrivateContainerScriptPath = ctx.getNmPrivateContainerScriptPath(); Path nmPrivateTokensPath = ctx.getNmPrivateTokensPath(); String us...
DockerContainerExecutor extends ContainerExecutor { @Override public int launchContainer(ContainerStartContext ctx) throws IOException { Container container = ctx.getContainer(); Path nmPrivateContainerScriptPath = ctx.getNmPrivateContainerScriptPath(); Path nmPrivateTokensPath = ctx.getNmPrivateTokensPath(); String us...
DockerContainerExecutor extends ContainerExecutor { @Override public int launchContainer(ContainerStartContext ctx) throws IOException { Container container = ctx.getContainer(); Path nmPrivateContainerScriptPath = ctx.getNmPrivateContainerScriptPath(); Path nmPrivateTokensPath = ctx.getNmPrivateTokensPath(); String us...
DockerContainerExecutor extends ContainerExecutor { @Override public int launchContainer(ContainerStartContext ctx) throws IOException { Container container = ctx.getContainer(); Path nmPrivateContainerScriptPath = ctx.getNmPrivateContainerScriptPath(); Path nmPrivateTokensPath = ctx.getNmPrivateTokensPath(); String us...
@Test(timeout = 30000) public void testStartLocalizer() throws IOException, InterruptedException { InetSocketAddress localizationServerAddress; final Path firstDir = new Path(BASE_TMP_PATH, "localDir1"); List<String> localDirs = new ArrayList<String>(); final Path secondDir = new Path(BASE_TMP_PATH, "localDir2"); List<...
@Override public void startLocalizer(LocalizerStartContext ctx) throws IOException, InterruptedException { Path nmPrivateContainerTokensPath = ctx.getNmPrivateContainerTokens(); InetSocketAddress nmAddr = ctx.getNmAddr(); String user = ctx.getUser(); String appId = ctx.getAppId(); String locId = ctx.getLocId(); LocalDi...
DefaultContainerExecutor extends ContainerExecutor { @Override public void startLocalizer(LocalizerStartContext ctx) throws IOException, InterruptedException { Path nmPrivateContainerTokensPath = ctx.getNmPrivateContainerTokens(); InetSocketAddress nmAddr = ctx.getNmAddr(); String user = ctx.getUser(); String appId = c...
DefaultContainerExecutor extends ContainerExecutor { @Override public void startLocalizer(LocalizerStartContext ctx) throws IOException, InterruptedException { Path nmPrivateContainerTokensPath = ctx.getNmPrivateContainerTokens(); InetSocketAddress nmAddr = ctx.getNmAddr(); String user = ctx.getUser(); String appId = c...
DefaultContainerExecutor extends ContainerExecutor { @Override public void startLocalizer(LocalizerStartContext ctx) throws IOException, InterruptedException { Path nmPrivateContainerTokensPath = ctx.getNmPrivateContainerTokens(); InetSocketAddress nmAddr = ctx.getNmAddr(); String user = ctx.getUser(); String appId = c...
DefaultContainerExecutor extends ContainerExecutor { @Override public void startLocalizer(LocalizerStartContext ctx) throws IOException, InterruptedException { Path nmPrivateContainerTokensPath = ctx.getNmPrivateContainerTokens(); InetSocketAddress nmAddr = ctx.getNmAddr(); String user = ctx.getUser(); String appId = c...
@Test public void testBootstrap() { TrafficControlBandwidthHandlerImpl handlerImpl = new TrafficControlBandwidthHandlerImpl(privilegedOperationExecutorMock, cGroupsHandlerMock, trafficControllerMock); try { handlerImpl.bootstrap(conf); verify(cGroupsHandlerMock).mountCGroupController( eq(CGroupsHandler.CGroupController...
@Override public List<PrivilegedOperation> bootstrap(Configuration configuration) throws ResourceHandlerException { conf = configuration; cGroupsHandler .mountCGroupController(CGroupsHandler.CGroupController.NET_CLS); device = conf.get(YarnConfiguration.NM_NETWORK_RESOURCE_INTERFACE, YarnConfiguration.DEFAULT_NM_NETWOR...
TrafficControlBandwidthHandlerImpl implements OutboundBandwidthResourceHandler { @Override public List<PrivilegedOperation> bootstrap(Configuration configuration) throws ResourceHandlerException { conf = configuration; cGroupsHandler .mountCGroupController(CGroupsHandler.CGroupController.NET_CLS); device = conf.get(Yar...
TrafficControlBandwidthHandlerImpl implements OutboundBandwidthResourceHandler { @Override public List<PrivilegedOperation> bootstrap(Configuration configuration) throws ResourceHandlerException { conf = configuration; cGroupsHandler .mountCGroupController(CGroupsHandler.CGroupController.NET_CLS); device = conf.get(Yar...
TrafficControlBandwidthHandlerImpl implements OutboundBandwidthResourceHandler { @Override public List<PrivilegedOperation> bootstrap(Configuration configuration) throws ResourceHandlerException { conf = configuration; cGroupsHandler .mountCGroupController(CGroupsHandler.CGroupController.NET_CLS); device = conf.get(Yar...
TrafficControlBandwidthHandlerImpl implements OutboundBandwidthResourceHandler { @Override public List<PrivilegedOperation> bootstrap(Configuration configuration) throws ResourceHandlerException { conf = configuration; cGroupsHandler .mountCGroupController(CGroupsHandler.CGroupController.NET_CLS); device = conf.get(Yar...
@Test public void testLifeCycle() { TrafficController trafficControllerSpy = spy(new TrafficController(conf, privilegedOperationExecutorMock)); TrafficControlBandwidthHandlerImpl handlerImpl = new TrafficControlBandwidthHandlerImpl(privilegedOperationExecutorMock, cGroupsHandlerMock, trafficControllerSpy); try { handle...
@Override public List<PrivilegedOperation> bootstrap(Configuration configuration) throws ResourceHandlerException { conf = configuration; cGroupsHandler .mountCGroupController(CGroupsHandler.CGroupController.NET_CLS); device = conf.get(YarnConfiguration.NM_NETWORK_RESOURCE_INTERFACE, YarnConfiguration.DEFAULT_NM_NETWOR...
TrafficControlBandwidthHandlerImpl implements OutboundBandwidthResourceHandler { @Override public List<PrivilegedOperation> bootstrap(Configuration configuration) throws ResourceHandlerException { conf = configuration; cGroupsHandler .mountCGroupController(CGroupsHandler.CGroupController.NET_CLS); device = conf.get(Yar...
TrafficControlBandwidthHandlerImpl implements OutboundBandwidthResourceHandler { @Override public List<PrivilegedOperation> bootstrap(Configuration configuration) throws ResourceHandlerException { conf = configuration; cGroupsHandler .mountCGroupController(CGroupsHandler.CGroupController.NET_CLS); device = conf.get(Yar...
TrafficControlBandwidthHandlerImpl implements OutboundBandwidthResourceHandler { @Override public List<PrivilegedOperation> bootstrap(Configuration configuration) throws ResourceHandlerException { conf = configuration; cGroupsHandler .mountCGroupController(CGroupsHandler.CGroupController.NET_CLS); device = conf.get(Yar...
TrafficControlBandwidthHandlerImpl implements OutboundBandwidthResourceHandler { @Override public List<PrivilegedOperation> bootstrap(Configuration configuration) throws ResourceHandlerException { conf = configuration; cGroupsHandler .mountCGroupController(CGroupsHandler.CGroupController.NET_CLS); device = conf.get(Yar...
@Test public void testBootstrapRecoveryDisabled() { conf.setBoolean(YarnConfiguration.NM_RECOVERY_ENABLED, false); TrafficController trafficController = new TrafficController(conf, privilegedOperationExecutorMock); try { trafficController .bootstrap(DEVICE, ROOT_BANDWIDTH_MBIT, YARN_BANDWIDTH_MBIT, CONTAINER_BANDWIDTH_...
public void bootstrap(String device, int rootBandwidthMbit, int yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode) throws ResourceHandlerException { if (device == null) { throw new ResourceHandlerException("device cannot be null!"); } String tmpDirBase = conf.get("hadoop.tmp.dir"); if (tmpDirBase == nul...
TrafficController { public void bootstrap(String device, int rootBandwidthMbit, int yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode) throws ResourceHandlerException { if (device == null) { throw new ResourceHandlerException("device cannot be null!"); } String tmpDirBase = conf.get("hadoop.tmp.dir"); i...
TrafficController { public void bootstrap(String device, int rootBandwidthMbit, int yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode) throws ResourceHandlerException { if (device == null) { throw new ResourceHandlerException("device cannot be null!"); } String tmpDirBase = conf.get("hadoop.tmp.dir"); i...
TrafficController { public void bootstrap(String device, int rootBandwidthMbit, int yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode) throws ResourceHandlerException { if (device == null) { throw new ResourceHandlerException("device cannot be null!"); } String tmpDirBase = conf.get("hadoop.tmp.dir"); i...
TrafficController { public void bootstrap(String device, int rootBandwidthMbit, int yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode) throws ResourceHandlerException { if (device == null) { throw new ResourceHandlerException("device cannot be null!"); } String tmpDirBase = conf.get("hadoop.tmp.dir"); i...
@Test public void testBootstrapRecoveryEnabled() { conf.setBoolean(YarnConfiguration.NM_RECOVERY_ENABLED, true); TrafficController trafficController = new TrafficController(conf, privilegedOperationExecutorMock); try { when(privilegedOperationExecutorMock.executePrivilegedOperation( any(PrivilegedOperation.class), eq(t...
public void bootstrap(String device, int rootBandwidthMbit, int yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode) throws ResourceHandlerException { if (device == null) { throw new ResourceHandlerException("device cannot be null!"); } String tmpDirBase = conf.get("hadoop.tmp.dir"); if (tmpDirBase == nul...
TrafficController { public void bootstrap(String device, int rootBandwidthMbit, int yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode) throws ResourceHandlerException { if (device == null) { throw new ResourceHandlerException("device cannot be null!"); } String tmpDirBase = conf.get("hadoop.tmp.dir"); i...
TrafficController { public void bootstrap(String device, int rootBandwidthMbit, int yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode) throws ResourceHandlerException { if (device == null) { throw new ResourceHandlerException("device cannot be null!"); } String tmpDirBase = conf.get("hadoop.tmp.dir"); i...
TrafficController { public void bootstrap(String device, int rootBandwidthMbit, int yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode) throws ResourceHandlerException { if (device == null) { throw new ResourceHandlerException("device cannot be null!"); } String tmpDirBase = conf.get("hadoop.tmp.dir"); i...
TrafficController { public void bootstrap(String device, int rootBandwidthMbit, int yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode) throws ResourceHandlerException { if (device == null) { throw new ResourceHandlerException("device cannot be null!"); } String tmpDirBase = conf.get("hadoop.tmp.dir"); i...
@Test public void testInvalidBuilder() { conf.setBoolean(YarnConfiguration.NM_RECOVERY_ENABLED, false); TrafficController trafficController = new TrafficController(conf, privilegedOperationExecutorMock); try { trafficController .bootstrap(DEVICE, ROOT_BANDWIDTH_MBIT, YARN_BANDWIDTH_MBIT, CONTAINER_BANDWIDTH_MBIT, false...
public void bootstrap(String device, int rootBandwidthMbit, int yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode) throws ResourceHandlerException { if (device == null) { throw new ResourceHandlerException("device cannot be null!"); } String tmpDirBase = conf.get("hadoop.tmp.dir"); if (tmpDirBase == nul...
TrafficController { public void bootstrap(String device, int rootBandwidthMbit, int yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode) throws ResourceHandlerException { if (device == null) { throw new ResourceHandlerException("device cannot be null!"); } String tmpDirBase = conf.get("hadoop.tmp.dir"); i...
TrafficController { public void bootstrap(String device, int rootBandwidthMbit, int yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode) throws ResourceHandlerException { if (device == null) { throw new ResourceHandlerException("device cannot be null!"); } String tmpDirBase = conf.get("hadoop.tmp.dir"); i...
TrafficController { public void bootstrap(String device, int rootBandwidthMbit, int yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode) throws ResourceHandlerException { if (device == null) { throw new ResourceHandlerException("device cannot be null!"); } String tmpDirBase = conf.get("hadoop.tmp.dir"); i...
TrafficController { public void bootstrap(String device, int rootBandwidthMbit, int yarnBandwidthMbit, int containerBandwidthMbit, boolean strictMode) throws ResourceHandlerException { if (device == null) { throw new ResourceHandlerException("device cannot be null!"); } String tmpDirBase = conf.get("hadoop.tmp.dir"); i...
@Test public void testClassIdFileContentParsing() { conf.setBoolean(YarnConfiguration.NM_RECOVERY_ENABLED, false); TrafficController trafficController = new TrafficController(conf, privilegedOperationExecutorMock); int parsedClassId = trafficController.getClassIdFromFileContents (TEST_CLASS_ID_DECIMAL_STR); Assert.asse...
public int getClassIdFromFileContents(String input) { String classIdStr = String.format("%08x", Integer.parseInt(input)); if (LOG.isDebugEnabled()) { LOG.debug("ClassId hex string : " + classIdStr); } return Integer.parseInt(classIdStr.substring(4)); }
TrafficController { public int getClassIdFromFileContents(String input) { String classIdStr = String.format("%08x", Integer.parseInt(input)); if (LOG.isDebugEnabled()) { LOG.debug("ClassId hex string : " + classIdStr); } return Integer.parseInt(classIdStr.substring(4)); } }
TrafficController { public int getClassIdFromFileContents(String input) { String classIdStr = String.format("%08x", Integer.parseInt(input)); if (LOG.isDebugEnabled()) { LOG.debug("ClassId hex string : " + classIdStr); } return Integer.parseInt(classIdStr.substring(4)); } TrafficController(Configuration conf, Privilege...
TrafficController { public int getClassIdFromFileContents(String input) { String classIdStr = String.format("%08x", Integer.parseInt(input)); if (LOG.isDebugEnabled()) { LOG.debug("ClassId hex string : " + classIdStr); } return Integer.parseInt(classIdStr.substring(4)); } TrafficController(Configuration conf, Privilege...
TrafficController { public int getClassIdFromFileContents(String input) { String classIdStr = String.format("%08x", Integer.parseInt(input)); if (LOG.isDebugEnabled()) { LOG.debug("ClassId hex string : " + classIdStr); } return Integer.parseInt(classIdStr.substring(4)); } TrafficController(Configuration conf, Privilege...
@Test public void testMountController() { CGroupsHandler cGroupsHandler = null; verifyZeroInteractions(privilegedOperationExecutorMock); try { cGroupsHandler = new CGroupsHandlerImpl(conf, privilegedOperationExecutorMock); PrivilegedOperation expectedOp = new PrivilegedOperation (PrivilegedOperation.OperationType.MOUNT...
@Override public void mountCGroupController(CGroupController controller) throws ResourceHandlerException { if (!enableCGroupMount) { LOG.warn("CGroup mounting is disabled - ignoring mount request for: " + controller.getName()); return; } String path = getControllerPath(controller); if (path == null) { try { rwLock.writ...
CGroupsHandlerImpl implements CGroupsHandler { @Override public void mountCGroupController(CGroupController controller) throws ResourceHandlerException { if (!enableCGroupMount) { LOG.warn("CGroup mounting is disabled - ignoring mount request for: " + controller.getName()); return; } String path = getControllerPath(con...
CGroupsHandlerImpl implements CGroupsHandler { @Override public void mountCGroupController(CGroupController controller) throws ResourceHandlerException { if (!enableCGroupMount) { LOG.warn("CGroup mounting is disabled - ignoring mount request for: " + controller.getName()); return; } String path = getControllerPath(con...
CGroupsHandlerImpl implements CGroupsHandler { @Override public void mountCGroupController(CGroupController controller) throws ResourceHandlerException { if (!enableCGroupMount) { LOG.warn("CGroup mounting is disabled - ignoring mount request for: " + controller.getName()); return; } String path = getControllerPath(con...
CGroupsHandlerImpl implements CGroupsHandler { @Override public void mountCGroupController(CGroupController controller) throws ResourceHandlerException { if (!enableCGroupMount) { LOG.warn("CGroup mounting is disabled - ignoring mount request for: " + controller.getName()); return; } String path = getControllerPath(con...
@Test public void testSetGracePeriod() throws Exception { dockerStopCommand.setGracePeriod(GRACE_PERIOD); assertEquals("stop foo --time=10", dockerStopCommand.getCommandWithArguments()); }
public DockerStopCommand setGracePeriod(int value) { super.addCommandArguments("--time=" + Integer.toString(value)); return this; }
DockerStopCommand extends DockerCommand { public DockerStopCommand setGracePeriod(int value) { super.addCommandArguments("--time=" + Integer.toString(value)); return this; } }
DockerStopCommand extends DockerCommand { public DockerStopCommand setGracePeriod(int value) { super.addCommandArguments("--time=" + Integer.toString(value)); return this; } DockerStopCommand(String containerName); }
DockerStopCommand extends DockerCommand { public DockerStopCommand setGracePeriod(int value) { super.addCommandArguments("--time=" + Integer.toString(value)); return this; } DockerStopCommand(String containerName); DockerStopCommand setGracePeriod(int value); }
DockerStopCommand extends DockerCommand { public DockerStopCommand setGracePeriod(int value) { super.addCommandArguments("--time=" + Integer.toString(value)); return this; } DockerStopCommand(String containerName); DockerStopCommand setGracePeriod(int value); }
@Test public void testGetContainerStatus() throws Exception { dockerInspectCommand.getContainerStatus(); assertEquals("inspect --format='{{.State.Status}}' foo", dockerInspectCommand.getCommandWithArguments()); }
public DockerInspectCommand getContainerStatus() { super.addCommandArguments("--format='{{.State.Status}}'"); super.addCommandArguments(containerName); return this; }
DockerInspectCommand extends DockerCommand { public DockerInspectCommand getContainerStatus() { super.addCommandArguments("--format='{{.State.Status}}'"); super.addCommandArguments(containerName); return this; } }
DockerInspectCommand extends DockerCommand { public DockerInspectCommand getContainerStatus() { super.addCommandArguments("--format='{{.State.Status}}'"); super.addCommandArguments(containerName); return this; } DockerInspectCommand(String containerName); }
DockerInspectCommand extends DockerCommand { public DockerInspectCommand getContainerStatus() { super.addCommandArguments("--format='{{.State.Status}}'"); super.addCommandArguments(containerName); return this; } DockerInspectCommand(String containerName); DockerInspectCommand getContainerStatus(); }
DockerInspectCommand extends DockerCommand { public DockerInspectCommand getContainerStatus() { super.addCommandArguments("--format='{{.State.Status}}'"); super.addCommandArguments(containerName); return this; } DockerInspectCommand(String containerName); DockerInspectCommand getContainerStatus(); }
@Test public void testGetLocalResourcesAllTags() throws Exception { Set<String> all = OwnLocalResources.getLocalResourcesAllTags(); assertTrue(all.contains("centos6")); assertTrue(all.contains("centos7")); assertTrue(all.contains("macos10")); }
public static Set<String> getLocalResourcesAllTags(){ Set<String> all = new HashSet<>(); all.add(LR_TAG_CENTOS6); all.add(LR_TAG_CENTOS7); all.add(LR_TAG_MACOS10); return all; }
OwnLocalResources { public static Set<String> getLocalResourcesAllTags(){ Set<String> all = new HashSet<>(); all.add(LR_TAG_CENTOS6); all.add(LR_TAG_CENTOS7); all.add(LR_TAG_MACOS10); return all; } }
OwnLocalResources { public static Set<String> getLocalResourcesAllTags(){ Set<String> all = new HashSet<>(); all.add(LR_TAG_CENTOS6); all.add(LR_TAG_CENTOS7); all.add(LR_TAG_MACOS10); return all; } OwnLocalResources(String thisNodeTag); OwnLocalResources(); }
OwnLocalResources { public static Set<String> getLocalResourcesAllTags(){ Set<String> all = new HashSet<>(); all.add(LR_TAG_CENTOS6); all.add(LR_TAG_CENTOS7); all.add(LR_TAG_MACOS10); return all; } OwnLocalResources(String thisNodeTag); OwnLocalResources(); static Set<String> getLocalResourcesAllTags(); static String ...
OwnLocalResources { public static Set<String> getLocalResourcesAllTags(){ Set<String> all = new HashSet<>(); all.add(LR_TAG_CENTOS6); all.add(LR_TAG_CENTOS7); all.add(LR_TAG_MACOS10); return all; } OwnLocalResources(String thisNodeTag); OwnLocalResources(); static Set<String> getLocalResourcesAllTags(); static String ...
@Test public void testSplitTagAndBasename() throws Exception { OwnLocalResources olr = new OwnLocalResources(); Pair<String,Path> pair = olr.splitTagAndBasename(new Path("hello/_native_centos7_liba.so")); assertEquals("centos7", pair.getFirst()); assertEquals("hello/liba.so", pair.getSecond().toString()); pair = olr.sp...
public Pair<String,Path> splitTagAndBasename(Path path){ String name = path.getName(); Path parent = path.getParent(); if(name.startsWith(LR_PREFIX) == false){ return null; } name = name.substring(LR_PREFIX.length()); int underscore = name.indexOf(LR_TAG_DELIM); if(underscore == -1){ return null; } String tag = name.su...
OwnLocalResources { public Pair<String,Path> splitTagAndBasename(Path path){ String name = path.getName(); Path parent = path.getParent(); if(name.startsWith(LR_PREFIX) == false){ return null; } name = name.substring(LR_PREFIX.length()); int underscore = name.indexOf(LR_TAG_DELIM); if(underscore == -1){ return null; } ...
OwnLocalResources { public Pair<String,Path> splitTagAndBasename(Path path){ String name = path.getName(); Path parent = path.getParent(); if(name.startsWith(LR_PREFIX) == false){ return null; } name = name.substring(LR_PREFIX.length()); int underscore = name.indexOf(LR_TAG_DELIM); if(underscore == -1){ return null; } ...
OwnLocalResources { public Pair<String,Path> splitTagAndBasename(Path path){ String name = path.getName(); Path parent = path.getParent(); if(name.startsWith(LR_PREFIX) == false){ return null; } name = name.substring(LR_PREFIX.length()); int underscore = name.indexOf(LR_TAG_DELIM); if(underscore == -1){ return null; } ...
OwnLocalResources { public Pair<String,Path> splitTagAndBasename(Path path){ String name = path.getName(); Path parent = path.getParent(); if(name.startsWith(LR_PREFIX) == false){ return null; } name = name.substring(LR_PREFIX.length()); int underscore = name.indexOf(LR_TAG_DELIM); if(underscore == -1){ return null; } ...
@Test public void testFilterLocalResources() throws Exception { Map<Path,List<String>> localResources = new HashMap<>(); Path path1 = new Path("/data1/liba.so"); Path path2 = new Path("/data1/liba_centos7.so"); List<String> syms1 = Arrays.asList("liba.so"); List<String> syms2 = Arrays.asList("_native_centos7_liba.so");...
public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thisNodeTag == null){ r...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
@Test public void testFilterLocalResources2() throws Exception { Map<Path,List<String>> localResources = new HashMap<>(); Path path1 = new Path("/data1/liba.so"); Path path2 = new Path("/data1/makecoll"); List<String> syms1 = Arrays.asList("liba.so"); List<String> syms2 = Arrays.asList("makecoll"); localResources.put(p...
public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thisNodeTag == null){ r...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
@Test public void testFilterLocalResources3() throws Exception { Map<Path,List<String>> localResources = new HashMap<>(); Path path1 = new Path("/data1/liba_centos6.so"); Path path2 = new Path("/data1/liba_centos7.so"); List<String> syms1 = Arrays.asList("lib/_native_centos6_liba.so"); List<String> syms2 = Arrays.asLis...
public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thisNodeTag == null){ r...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
@Test public void testFilterLocalResources4() throws Exception { Map<Path,List<String>> localResources = new HashMap<>(); Path path1 = new Path("/data1/liba_centos6.so"); Path path2 = new Path("/data1/liba_centos7.so"); List<String> syms1 = Arrays.asList("lib/_native_centos6_liba.so", "centos6.data"); List<String> syms...
public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thisNodeTag == null){ r...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
@Test public void testFilterLocalResources5() throws Exception { Map<Path,List<String>> localResources = new HashMap<>(); Path path1 = new Path("/data1/liba_centos6.so"); Path path2 = new Path("/data1/liba_centos7.so"); List<String> syms1 = Arrays.asList("lib/_native_centos6_liba.so", "_native_centos7_libb.so"); List<S...
public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thisNodeTag == null){ r...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
OwnLocalResources { public Map<Path,List<String>> filterLocalResources(Map<Path,List<String>> originLocalResources){ Map<Path,Path> linkNameMap = new HashMap<>(); Map<Path,List<String>> filteredLRs = new HashMap<>(); Map<Path,Path> taggingLinkNameMap = new HashMap<>(); Map<String,Path> ignores = new HashMap<>(); if(thi...
@Test(timeout = 10000) public void testEnvExpansion() throws IOException { Path logPath = new Path("/nm/container/logs"); String input = Apps.crossPlatformify("HADOOP_HOME") + "/share/hadoop/common/*" + ApplicationConstants.CLASS_PATH_SEPARATOR + Apps.crossPlatformify("HADOOP_HOME") + "/share/hadoop/common/lib/*" + App...
@VisibleForTesting public static String expandEnvironment(String var, Path containerLogDir) { var = var.replace(ApplicationConstants.LOG_DIR_EXPANSION_VAR, containerLogDir.toString()); var = var.replace(ApplicationConstants.CLASS_PATH_SEPARATOR, File.pathSeparator); if (Shell.WINDOWS) { var = var.replaceAll("(\\{\\{)|(...
ContainerLaunch implements Callable<Integer> { @VisibleForTesting public static String expandEnvironment(String var, Path containerLogDir) { var = var.replace(ApplicationConstants.LOG_DIR_EXPANSION_VAR, containerLogDir.toString()); var = var.replace(ApplicationConstants.CLASS_PATH_SEPARATOR, File.pathSeparator); if (Sh...
ContainerLaunch implements Callable<Integer> { @VisibleForTesting public static String expandEnvironment(String var, Path containerLogDir) { var = var.replace(ApplicationConstants.LOG_DIR_EXPANSION_VAR, containerLogDir.toString()); var = var.replace(ApplicationConstants.CLASS_PATH_SEPARATOR, File.pathSeparator); if (Sh...
ContainerLaunch implements Callable<Integer> { @VisibleForTesting public static String expandEnvironment(String var, Path containerLogDir) { var = var.replace(ApplicationConstants.LOG_DIR_EXPANSION_VAR, containerLogDir.toString()); var = var.replace(ApplicationConstants.CLASS_PATH_SEPARATOR, File.pathSeparator); if (Sh...
ContainerLaunch implements Callable<Integer> { @VisibleForTesting public static String expandEnvironment(String var, Path containerLogDir) { var = var.replace(ApplicationConstants.LOG_DIR_EXPANSION_VAR, containerLogDir.toString()); var = var.replace(ApplicationConstants.CLASS_PATH_SEPARATOR, File.pathSeparator); if (Sh...
@Test public void testPrependDistcache() throws Exception { Assume.assumeTrue(Shell.WINDOWS); ContainerLaunchContext containerLaunchContext = recordFactory.newRecordInstance(ContainerLaunchContext.class); ApplicationId appId = ApplicationId.newInstance(0, 0); ApplicationAttemptId appAttemptId = ApplicationAttemptId.new...
public void sanitizeEnv(Map<String, String> environment, Path pwd, List<Path> appDirs, List<String> userLocalDirs, List<String> containerLogDirs, Map<Path, List<String>> resources, Path nmPrivateClasspathJarDir) throws IOException { environment.put(Environment.CONTAINER_ID.name(), container .getContainerId().toString()...
ContainerLaunch implements Callable<Integer> { public void sanitizeEnv(Map<String, String> environment, Path pwd, List<Path> appDirs, List<String> userLocalDirs, List<String> containerLogDirs, Map<Path, List<String>> resources, Path nmPrivateClasspathJarDir) throws IOException { environment.put(Environment.CONTAINER_ID...
ContainerLaunch implements Callable<Integer> { public void sanitizeEnv(Map<String, String> environment, Path pwd, List<Path> appDirs, List<String> userLocalDirs, List<String> containerLogDirs, Map<Path, List<String>> resources, Path nmPrivateClasspathJarDir) throws IOException { environment.put(Environment.CONTAINER_ID...
ContainerLaunch implements Callable<Integer> { public void sanitizeEnv(Map<String, String> environment, Path pwd, List<Path> appDirs, List<String> userLocalDirs, List<String> containerLogDirs, Map<Path, List<String>> resources, Path nmPrivateClasspathJarDir) throws IOException { environment.put(Environment.CONTAINER_ID...
ContainerLaunch implements Callable<Integer> { public void sanitizeEnv(Map<String, String> environment, Path pwd, List<Path> appDirs, List<String> userLocalDirs, List<String> containerLogDirs, Map<Path, List<String>> resources, Path nmPrivateClasspathJarDir) throws IOException { environment.put(Environment.CONTAINER_ID...
@Test (timeout = 60000) public void testContainerEnvVariables() throws Exception { containerManager.start(); ContainerLaunchContext containerLaunchContext = recordFactory.newRecordInstance(ContainerLaunchContext.class); ApplicationId appId = ApplicationId.newInstance(0, 0); ApplicationAttemptId appAttemptId = Applicati...
public static String getRelativeContainerLogDir(String appIdStr, String containerIdStr) { return appIdStr + Path.SEPARATOR + containerIdStr; }
ContainerLaunch implements Callable<Integer> { public static String getRelativeContainerLogDir(String appIdStr, String containerIdStr) { return appIdStr + Path.SEPARATOR + containerIdStr; } }
ContainerLaunch implements Callable<Integer> { public static String getRelativeContainerLogDir(String appIdStr, String containerIdStr) { return appIdStr + Path.SEPARATOR + containerIdStr; } ContainerLaunch(Context context, Configuration configuration, Dispatcher dispatcher, ContainerExecutor exec, Application app...
ContainerLaunch implements Callable<Integer> { public static String getRelativeContainerLogDir(String appIdStr, String containerIdStr) { return appIdStr + Path.SEPARATOR + containerIdStr; } ContainerLaunch(Context context, Configuration configuration, Dispatcher dispatcher, ContainerExecutor exec, Application app...
ContainerLaunch implements Callable<Integer> { public static String getRelativeContainerLogDir(String appIdStr, String containerIdStr) { return appIdStr + Path.SEPARATOR + containerIdStr; } ContainerLaunch(Context context, Configuration configuration, Dispatcher dispatcher, ContainerExecutor exec, Application app...
@SuppressWarnings("rawtypes") @Test (timeout = 10000) public void testCallFailureWithNullLocalizedResources() { Container container = mock(Container.class); when(container.getContainerId()).thenReturn(ContainerId.newContainerId( ApplicationAttemptId.newInstance(ApplicationId.newInstance( System.currentTimeMillis(), 1),...
@Override @SuppressWarnings("unchecked") public Integer call() { final ContainerLaunchContext launchContext = container.getLaunchContext(); Map<Path,List<String>> localResources = null; ContainerId containerID = container.getContainerId(); String containerIdStr = ConverterUtils.toString(containerID); final List<String>...
ContainerLaunch implements Callable<Integer> { @Override @SuppressWarnings("unchecked") public Integer call() { final ContainerLaunchContext launchContext = container.getLaunchContext(); Map<Path,List<String>> localResources = null; ContainerId containerID = container.getContainerId(); String containerIdStr = Converter...
ContainerLaunch implements Callable<Integer> { @Override @SuppressWarnings("unchecked") public Integer call() { final ContainerLaunchContext launchContext = container.getLaunchContext(); Map<Path,List<String>> localResources = null; ContainerId containerID = container.getContainerId(); String containerIdStr = Converter...
ContainerLaunch implements Callable<Integer> { @Override @SuppressWarnings("unchecked") public Integer call() { final ContainerLaunchContext launchContext = container.getLaunchContext(); Map<Path,List<String>> localResources = null; ContainerId containerID = container.getContainerId(); String containerIdStr = Converter...
ContainerLaunch implements Callable<Integer> { @Override @SuppressWarnings("unchecked") public Integer call() { final ContainerLaunchContext launchContext = container.getLaunchContext(); Map<Path,List<String>> localResources = null; ContainerId containerID = container.getContainerId(); String containerIdStr = Converter...
@Test(timeout = 1000) @SuppressWarnings("unchecked") public void testLocalResourceCache() { String user = "testuser"; DrainDispatcher dispatcher = null; try { Configuration conf = new Configuration(); dispatcher = createDispatcher(conf); EventHandler<LocalizerEvent> localizerEventHandler = mock(EventHandler.class); Eve...
@Override public synchronized void handle(ResourceEvent event) { LocalResourceRequest req = event.getLocalResourceRequest(); LocalizedResource rsrc = localrsrc.get(req); switch (event.getType()) { case LOCALIZED: if (useLocalCacheDirectoryManager) { inProgressLocalResourcesMap.remove(req); } break; case REQUEST: if (rs...
LocalResourcesTrackerImpl implements LocalResourcesTracker { @Override public synchronized void handle(ResourceEvent event) { LocalResourceRequest req = event.getLocalResourceRequest(); LocalizedResource rsrc = localrsrc.get(req); switch (event.getType()) { case LOCALIZED: if (useLocalCacheDirectoryManager) { inProgres...
LocalResourcesTrackerImpl implements LocalResourcesTracker { @Override public synchronized void handle(ResourceEvent event) { LocalResourceRequest req = event.getLocalResourceRequest(); LocalizedResource rsrc = localrsrc.get(req); switch (event.getType()) { case LOCALIZED: if (useLocalCacheDirectoryManager) { inProgres...
LocalResourcesTrackerImpl implements LocalResourcesTracker { @Override public synchronized void handle(ResourceEvent event) { LocalResourceRequest req = event.getLocalResourceRequest(); LocalizedResource rsrc = localrsrc.get(req); switch (event.getType()) { case LOCALIZED: if (useLocalCacheDirectoryManager) { inProgres...
LocalResourcesTrackerImpl implements LocalResourcesTracker { @Override public synchronized void handle(ResourceEvent event) { LocalResourceRequest req = event.getLocalResourceRequest(); LocalizedResource rsrc = localrsrc.get(req); switch (event.getType()) { case LOCALIZED: if (useLocalCacheDirectoryManager) { inProgres...
@Test(timeout = 3000000) public void testResourceTypes() throws Exception { HashMap<YarnConfiguration, EnumSet<SchedulerResourceTypes>> driver = new HashMap<YarnConfiguration, EnumSet<SchedulerResourceTypes>>(); CapacitySchedulerConfiguration csconf = new CapacitySchedulerConfiguration(); csconf.setResourceComparator(D...
public void registerAppAttempt(ApplicationAttemptId attemptId) { AllocateResponse response = recordFactory.newRecordInstance(AllocateResponse.class); response.setResponseId(-1); LOG.info("Registering app attempt : " + attemptId); responseMap.put(attemptId, new AllocateResponseLock(response)); rmContext.getNMTokenSecret...
ApplicationMasterService extends AbstractService implements ApplicationMasterProtocol { public void registerAppAttempt(ApplicationAttemptId attemptId) { AllocateResponse response = recordFactory.newRecordInstance(AllocateResponse.class); response.setResponseId(-1); LOG.info("Registering app attempt : " + attemptId)...
ApplicationMasterService extends AbstractService implements ApplicationMasterProtocol { public void registerAppAttempt(ApplicationAttemptId attemptId) { AllocateResponse response = recordFactory.newRecordInstance(AllocateResponse.class); response.setResponseId(-1); LOG.info("Registering app attempt : " + attemptId)...
ApplicationMasterService extends AbstractService implements ApplicationMasterProtocol { public void registerAppAttempt(ApplicationAttemptId attemptId) { AllocateResponse response = recordFactory.newRecordInstance(AllocateResponse.class); response.setResponseId(-1); LOG.info("Registering app attempt : " + attemptId)...
ApplicationMasterService extends AbstractService implements ApplicationMasterProtocol { public void registerAppAttempt(ApplicationAttemptId attemptId) { AllocateResponse response = recordFactory.newRecordInstance(AllocateResponse.class); response.setResponseId(-1); LOG.info("Registering app attempt : " + attemptId)...
@Test public void testIgnore() { int[][] qData = new int[][]{ { 100, 40, 40, 20 }, { 100, 100, 100, 100 }, { 100, 0, 60, 40 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 3, 1, 1, 1 }, { -1, 1, 1, 1 }, { 3, 0, 0, 0 }, }; ProportionalCapacityPreemptionPolicy policy = buildPolicy(qData); policy.editSchedule(); verify(mDisp, never(...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testProportionalPreemption() { int[][] qData = new int[][]{ { 100, 10, 40, 20, 30 }, { 100, 100, 100, 100, 100 }, { 100, 30, 60, 10, 0 }, { 45, 20, 5, 20, 0 }, { 0, 0, 0, 0, 0 }, { 3, 1, 1, 1, 0 }, { -1, 1, 1, 1, 1 }, { 4, 0, 0, 0, 0 }, }; ProportionalCapacityPreemptionPolicy policy = buildPolicy(qDat...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testMaxCap() { int[][] qData = new int[][]{ { 100, 40, 40, 20 }, { 100, 100, 45, 100 }, { 100, 55, 45, 0 }, { 20, 10, 10, 0 }, { 0, 0, 0, 0 }, { 2, 1, 1, 0 }, { -1, 1, 1, 0 }, { 3, 0, 0, 0 }, }; ProportionalCapacityPreemptionPolicy policy = buildPolicy(qData); policy.editSchedule(); verify(mDisp, neve...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testPreemptCycle() { int[][] qData = new int[][]{ { 100, 40, 40, 20 }, { 100, 100, 100, 100 }, { 100, 0, 60, 40 }, { 10, 10, 0, 0 }, { 0, 0, 0, 0 }, { 3, 1, 1, 1 }, { -1, 1, 1, 1 }, { 3, 0, 0, 0 }, }; ProportionalCapacityPreemptionPolicy policy = buildPolicy(qData); policy.editSchedule(); verify(mDisp...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testExpireKill() { final long killTime = 10000L; int[][] qData = new int[][]{ { 100, 40, 40, 20 }, { 100, 100, 100, 100 }, { 100, 0, 60, 40 }, { 10, 10, 0, 0 }, { 0, 0, 0, 0 }, { 3, 1, 1, 1 }, { -1, 1, 1, 1 }, { 3, 0, 0, 0 }, }; conf.setLong(WAIT_TIME_BEFORE_KILL, killTime); ProportionalCapacityPreemp...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testDeadzone() { int[][] qData = new int[][]{ { 100, 40, 40, 20 }, { 100, 100, 100, 100 }, { 100, 39, 43, 21 }, { 10, 10, 0, 0 }, { 0, 0, 0, 0 }, { 3, 1, 1, 1 }, { -1, 1, 1, 1 }, { 3, 0, 0, 0 }, }; conf.setFloat(MAX_IGNORED_OVER_CAPACITY, (float) 0.1); ProportionalCapacityPreemptionPolicy policy = bui...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testPerQueueDisablePreemption() { int[][] qData = new int[][]{ { 100, 55, 25, 20 }, { 100, 100, 100, 100 }, { 100, 0, 54, 46 }, { 10, 10, 0, 0 }, { 0, 0, 0, 0 }, { 3, 1, 1, 1 }, { -1, 1, 1, 1 }, { 3, 0, 0, 0 }, }; schedConf.setPreemptionDisabled("root.queueB", true); ProportionalCapacityPreemptionPoli...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testPerQueueDisablePreemptionHierarchical() { int[][] qData = new int[][] { { 200, 100, 50, 50, 100, 10, 90 }, { 200, 200, 200, 200, 200, 200, 200 }, { 200, 110, 60, 50, 90, 90, 0 }, { 10, 0, 0, 0, 10, 0, 10 }, { 0, 0, 0, 0, 0, 0, 0 }, { 4, 2, 1, 1, 2, 1, 1 }, { -1, -1, 1, 1, -1, 1, 1 }, { 2, 2, 0, 0,...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testPerQueueDisablePreemptionBroadHierarchical() { int[][] qData = new int[][] { {1000, 350, 150, 200, 400, 200, 200, 250, 100, 150 }, {1000,1000,1000,1000,1000,1000,1000,1000,1000,1000 }, {1000, 400, 200, 200, 400, 250, 150, 200, 150, 50 }, { 50, 0, 0, 0, 50, 0, 50, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, ...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testPerQueueDisablePreemptionInheritParent() { int[][] qData = new int[][] { {1000, 500, 200, 200, 100, 500, 200, 200, 100 }, {1000,1000,1000,1000,1000,1000,1000,1000,1000 }, {1000, 700, 0, 350, 350, 300, 0, 200, 100 }, { 200, 0, 0, 0, 0, 200, 200, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 5, 2, 0, 1, ...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testPerQueuePreemptionNotAllUntouchable() { int[][] qData = new int[][] { { 2000, 1000, 800, 100, 100, 1000, 500, 300, 200 }, { 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000, 2000 }, { 2000, 1300, 300, 800, 200, 700, 500, 0, 200 }, { 300, 0, 0, 0, 0, 300, 0, 300, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0 }, {...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testPerQueueDisablePreemptionRootDisablesAll() { int[][] qData = new int[][] { {1000, 500, 250, 250, 250, 100, 150, 250, 100, 150 }, {1000,1000,1000,1000,1000,1000,1000,1000,1000,1000 }, {1000, 20, 0, 20, 490, 240, 250, 490, 240, 250 }, { 200, 200, 200, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 0, 0, 0, 0, 0, 0,...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testPerQueueDisablePreemptionOverAbsMaxCapacity() { int[][] qData = new int[][] { {1000, 725, 360, 365, 275, 17, 258 }, {1000,1000,1000,1000, 550, 109,1000 }, {1000, 741, 396, 345, 259, 110, 149 }, { 40, 20, 0, 20, 20, 20, 0 }, { 0, 0, 0, 0, 0, 0, 0 }, { 4, 2, 1, 1, 2, 1, 1 }, { -1, -1, 1, 1, -1, 1, 1...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testOverCapacityImbalance() { int[][] qData = new int[][]{ { 100, 40, 40, 20 }, { 100, 100, 100, 100 }, { 100, 55, 45, 0 }, { 20, 10, 10, 0 }, { 0, 0, 0, 0 }, { 2, 1, 1, 0 }, { -1, 1, 1, 0 }, { 3, 0, 0, 0 }, }; ProportionalCapacityPreemptionPolicy policy = buildPolicy(qData); policy.editSchedule(); ve...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testNaturalTermination() { int[][] qData = new int[][]{ { 100, 40, 40, 20 }, { 100, 100, 100, 100 }, { 100, 55, 45, 0 }, { 20, 10, 10, 0 }, { 0, 0, 0, 0 }, { 2, 1, 1, 0 }, { -1, 1, 1, 0 }, { 3, 0, 0, 0 }, }; conf.setFloat(NATURAL_TERMINATION_FACTOR, (float) 0.1); ProportionalCapacityPreemptionPolicy p...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testObserveOnly() { int[][] qData = new int[][]{ { 100, 40, 40, 20 }, { 100, 100, 100, 100 }, { 100, 90, 10, 0 }, { 80, 10, 20, 50 }, { 0, 0, 0, 0 }, { 2, 1, 1, 0 }, { -1, 1, 1, 0 }, { 3, 0, 0, 0 }, }; conf.setBoolean(OBSERVE_ONLY, true); ProportionalCapacityPreemptionPolicy policy = buildPolicy(qData...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testHierarchical() { int[][] qData = new int[][] { { 200, 100, 50, 50, 100, 10, 90 }, { 200, 200, 200, 200, 200, 200, 200 }, { 200, 110, 60, 50, 90, 90, 0 }, { 10, 0, 0, 0, 10, 0, 10 }, { 0, 0, 0, 0, 0, 0, 0 }, { 4, 2, 1, 1, 2, 1, 1 }, { -1, -1, 1, 1, -1, 1, 1 }, { 2, 2, 0, 0, 2, 0, 0 }, }; Proportion...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testZeroGuar() { int[][] qData = new int[][] { { 200, 100, 0, 99, 100, 10, 90 }, { 200, 200, 200, 200, 200, 200, 200 }, { 170, 80, 60, 20, 90, 90, 0 }, { 10, 0, 0, 0, 10, 0, 10 }, { 0, 0, 0, 0, 0, 0, 0 }, { 4, 2, 1, 1, 2, 1, 1 }, { -1, -1, 1, 1, -1, 1, 1 }, { 2, 2, 0, 0, 2, 0, 0 }, }; ProportionalCapa...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testZeroGuarOverCap() { int[][] qData = new int[][] { { 200, 100, 0, 99, 0, 100, 100 }, { 200, 200, 200, 200, 200, 200, 200 }, { 170, 170, 60, 20, 90, 0, 0 }, { 85, 50, 30, 10, 10, 20, 20 }, { 0, 0, 0, 0, 0, 0, 0 }, { 4, 3, 1, 1, 1, 1, 1 }, { -1, -1, 1, 1, 1, -1, 1 }, { 2, 3, 0, 0, 0, 1, 0 }, }; Propo...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testHierarchicalLarge() { int[][] qData = new int[][] { { 400, 200, 60, 140, 100, 70, 30, 100, 10, 90 }, { 400, 400, 400, 400, 400, 400, 400, 400, 400, 400 }, { 400, 210, 70, 140, 100, 50, 50, 90, 90, 0 }, { 15, 0, 0, 0, 0, 0, 0, 0, 0, 15 }, { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, { 6, 2, 1, 1, 2, 1, 1, 2, ...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testContainerOrdering(){ List<RMContainer> containers = new ArrayList<RMContainer>(); ApplicationAttemptId appAttId = ApplicationAttemptId.newInstance( ApplicationId.newInstance(TS, 10), 0); RMContainer rm1 = mockContainer(appAttId, 5, mock(Resource.class), 3); RMContainer rm2 = mockContainer(appAttId...
@VisibleForTesting static void sortContainers(List<RMContainer> containers){ Collections.sort(containers, new Comparator<RMContainer>() { @Override public int compare(RMContainer a, RMContainer b) { Comparator<Priority> c = new org.apache.hadoop.yarn.server .resourcemanager.resource.Priority.Comparator(); int priorityC...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @VisibleForTesting static void sortContainers(List<RMContainer> containers){ Collections.sort(containers, new Comparator<RMContainer>() { @Override public int compare(RMContainer a, RMContainer b) { Comparator<Priority> c = new org.apache.hadoop.yar...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @VisibleForTesting static void sortContainers(List<RMContainer> containers){ Collections.sort(containers, new Comparator<RMContainer>() { @Override public int compare(RMContainer a, RMContainer b) { Comparator<Priority> c = new org.apache.hadoop.yar...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @VisibleForTesting static void sortContainers(List<RMContainer> containers){ Collections.sort(containers, new Comparator<RMContainer>() { @Override public int compare(RMContainer a, RMContainer b) { Comparator<Priority> c = new org.apache.hadoop.yar...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @VisibleForTesting static void sortContainers(List<RMContainer> containers){ Collections.sort(containers, new Comparator<RMContainer>() { @Override public int compare(RMContainer a, RMContainer b) { Comparator<Priority> c = new org.apache.hadoop.yar...
@Test public void testSkipAMContainer() { int[][] qData = new int[][] { { 100, 50, 50 }, { 100, 100, 100 }, { 100, 100, 0 }, { 70, 20, 50 }, { 0, 0, 0 }, { 5, 4, 1 }, { -1, 1, 1 }, { 2, 0, 0 }, }; setAMContainer = true; ProportionalCapacityPreemptionPolicy policy = buildPolicy(qData); policy.editSchedule(); verify(mDis...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testIdealAllocationForLabels() { int[][] qData = new int[][] { { 80, 40, 40 }, { 80, 80, 80 }, { 80, 80, 0 }, { 70, 20, 50 }, { 0, 0, 0 }, { 5, 4, 1 }, { -1, 1, 1 }, { 2, 0, 0 }, }; setAMContainer = true; setLabeledContainer = true; Map<NodeId, Set<String>> labels = new HashMap<NodeId, Set<String>>();...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testPreemptSkippedAMContainers() { int[][] qData = new int[][] { { 100, 10, 90 }, { 100, 100, 100 }, { 100, 100, 0 }, { 70, 20, 90 }, { 0, 0, 0 }, { 5, 4, 1 }, { -1, 5, 5 }, { 2, 0, 0 }, }; setAMContainer = true; ProportionalCapacityPreemptionPolicy policy = buildPolicy(qData); policy.editSchedule(); ...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test public void testAMResourcePercentForSkippedAMContainers() { int[][] qData = new int[][] { { 100, 10, 90 }, { 100, 100, 100 }, { 100, 100, 0 }, { 70, 20, 90 }, { 0, 0, 0 }, { 5, 4, 1 }, { -1, 5, 5 }, { 2, 0, 0 }, }; setAMContainer = true; setAMResourcePercent = 0.5f; ProportionalCapacityPreemptionPolicy policy = b...
@Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMContext().getNodeLabelManager() .getNodeLabels()); containerBasedPreemptO...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
ProportionalCapacityPreemptionPolicy implements SchedulingEditPolicy { @Override public void editSchedule() { CSQueue root = scheduler.getRootQueue(); Resource clusterResources = Resources.clone(scheduler.getClusterResource()); clusterResources = getNonLabeledResources(clusterResources); setNodeLabels(scheduler.getRMCo...
@Test (timeout = 50000) public void testGetNextHeartBeatInterval() throws Exception { Configuration conf = new Configuration(); conf.set(YarnConfiguration.RM_NM_HEARTBEAT_INTERVAL_MS, "4000"); rm = new MockRM(conf); rm.start(); MockNM nm1 = rm.registerNode("host1:1234", 5120); MockNM nm2 = rm.registerNode("host2:5678",...
@SuppressWarnings("unchecked") @Override public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request) throws YarnException, IOException { NodeStatus remoteNodeStatus = request.getNodeStatus(); NodeId nodeId = remoteNodeStatus.getNodeId(); if (!this.nodesListManager.isValidNode(nodeId.getHost())) { String me...
ResourceTrackerService extends AbstractService implements ResourceTracker { @SuppressWarnings("unchecked") @Override public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request) throws YarnException, IOException { NodeStatus remoteNodeStatus = request.getNodeStatus(); NodeId nodeId = remoteNodeStatus.ge...
ResourceTrackerService extends AbstractService implements ResourceTracker { @SuppressWarnings("unchecked") @Override public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request) throws YarnException, IOException { NodeStatus remoteNodeStatus = request.getNodeStatus(); NodeId nodeId = remoteNodeStatus.ge...
ResourceTrackerService extends AbstractService implements ResourceTracker { @SuppressWarnings("unchecked") @Override public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request) throws YarnException, IOException { NodeStatus remoteNodeStatus = request.getNodeStatus(); NodeId nodeId = remoteNodeStatus.ge...
ResourceTrackerService extends AbstractService implements ResourceTracker { @SuppressWarnings("unchecked") @Override public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request) throws YarnException, IOException { NodeStatus remoteNodeStatus = request.getNodeStatus(); NodeId nodeId = remoteNodeStatus.ge...
@Test public void testDecommissionWithIncludeHosts() throws Exception { writeToHostsFile("localhost", "host1", "host2"); Configuration conf = new Configuration(); conf.set(YarnConfiguration.RM_NODES_INCLUDE_FILE_PATH, hostFile .getAbsolutePath()); rm = new MockRM(conf); rm.start(); MockNM nm1 = rm.registerNode("host1:1...
@SuppressWarnings("unchecked") @Override public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request) throws YarnException, IOException { NodeStatus remoteNodeStatus = request.getNodeStatus(); NodeId nodeId = remoteNodeStatus.getNodeId(); if (!this.nodesListManager.isValidNode(nodeId.getHost())) { String me...
ResourceTrackerService extends AbstractService implements ResourceTracker { @SuppressWarnings("unchecked") @Override public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request) throws YarnException, IOException { NodeStatus remoteNodeStatus = request.getNodeStatus(); NodeId nodeId = remoteNodeStatus.ge...
ResourceTrackerService extends AbstractService implements ResourceTracker { @SuppressWarnings("unchecked") @Override public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request) throws YarnException, IOException { NodeStatus remoteNodeStatus = request.getNodeStatus(); NodeId nodeId = remoteNodeStatus.ge...
ResourceTrackerService extends AbstractService implements ResourceTracker { @SuppressWarnings("unchecked") @Override public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request) throws YarnException, IOException { NodeStatus remoteNodeStatus = request.getNodeStatus(); NodeId nodeId = remoteNodeStatus.ge...
ResourceTrackerService extends AbstractService implements ResourceTracker { @SuppressWarnings("unchecked") @Override public NodeHeartbeatResponse nodeHeartbeat(NodeHeartbeatRequest request) throws YarnException, IOException { NodeStatus remoteNodeStatus = request.getNodeStatus(); NodeId nodeId = remoteNodeStatus.ge...