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 testAllPreferredLocationCalculation() throws ExecutionException, InterruptedException { final TaskManagerLocation taskManagerLocation1 = new LocalTaskManagerLocation(); final TaskManagerLocation taskManagerLocation2 = new LocalTaskManagerLocation(); final TaskManagerLocation taskManagerLocation3 = new...
@VisibleForTesting public CompletableFuture<Collection<TaskManagerLocation>> calculatePreferredLocations(LocationPreferenceConstraint locationPreferenceConstraint) { final Collection<CompletableFuture<TaskManagerLocation>> preferredLocationFutures = getVertex().getPreferredLocations(); final CompletableFuture<Collectio...
Execution implements AccessExecution, Archiveable<ArchivedExecution>, LogicalSlot.Payload { @VisibleForTesting public CompletableFuture<Collection<TaskManagerLocation>> calculatePreferredLocations(LocationPreferenceConstraint locationPreferenceConstraint) { final Collection<CompletableFuture<TaskManagerLocation>> prefe...
Execution implements AccessExecution, Archiveable<ArchivedExecution>, LogicalSlot.Payload { @VisibleForTesting public CompletableFuture<Collection<TaskManagerLocation>> calculatePreferredLocations(LocationPreferenceConstraint locationPreferenceConstraint) { final Collection<CompletableFuture<TaskManagerLocation>> prefe...
Execution implements AccessExecution, Archiveable<ArchivedExecution>, LogicalSlot.Payload { @VisibleForTesting public CompletableFuture<Collection<TaskManagerLocation>> calculatePreferredLocations(LocationPreferenceConstraint locationPreferenceConstraint) { final Collection<CompletableFuture<TaskManagerLocation>> prefe...
Execution implements AccessExecution, Archiveable<ArchivedExecution>, LogicalSlot.Payload { @VisibleForTesting public CompletableFuture<Collection<TaskManagerLocation>> calculatePreferredLocations(LocationPreferenceConstraint locationPreferenceConstraint) { final Collection<CompletableFuture<TaskManagerLocation>> prefe...
@Test public void testAnyPreferredLocationCalculation() throws ExecutionException, InterruptedException { final TaskManagerLocation taskManagerLocation1 = new LocalTaskManagerLocation(); final TaskManagerLocation taskManagerLocation3 = new LocalTaskManagerLocation(); final CompletableFuture<TaskManagerLocation> locatio...
@VisibleForTesting public CompletableFuture<Collection<TaskManagerLocation>> calculatePreferredLocations(LocationPreferenceConstraint locationPreferenceConstraint) { final Collection<CompletableFuture<TaskManagerLocation>> preferredLocationFutures = getVertex().getPreferredLocations(); final CompletableFuture<Collectio...
Execution implements AccessExecution, Archiveable<ArchivedExecution>, LogicalSlot.Payload { @VisibleForTesting public CompletableFuture<Collection<TaskManagerLocation>> calculatePreferredLocations(LocationPreferenceConstraint locationPreferenceConstraint) { final Collection<CompletableFuture<TaskManagerLocation>> prefe...
Execution implements AccessExecution, Archiveable<ArchivedExecution>, LogicalSlot.Payload { @VisibleForTesting public CompletableFuture<Collection<TaskManagerLocation>> calculatePreferredLocations(LocationPreferenceConstraint locationPreferenceConstraint) { final Collection<CompletableFuture<TaskManagerLocation>> prefe...
Execution implements AccessExecution, Archiveable<ArchivedExecution>, LogicalSlot.Payload { @VisibleForTesting public CompletableFuture<Collection<TaskManagerLocation>> calculatePreferredLocations(LocationPreferenceConstraint locationPreferenceConstraint) { final Collection<CompletableFuture<TaskManagerLocation>> prefe...
Execution implements AccessExecution, Archiveable<ArchivedExecution>, LogicalSlot.Payload { @VisibleForTesting public CompletableFuture<Collection<TaskManagerLocation>> calculatePreferredLocations(LocationPreferenceConstraint locationPreferenceConstraint) { final Collection<CompletableFuture<TaskManagerLocation>> prefe...
@Test public void testArchive() throws IOException, ClassNotFoundException { ArchivedExecutionGraph archivedGraph = ArchivedExecutionGraph.createFrom(runtimeGraph); compareExecutionGraph(runtimeGraph, archivedGraph); }
public static ArchivedExecutionGraph createFrom(ExecutionGraph executionGraph) { final int numberVertices = executionGraph.getTotalNumberOfVertices(); Map<JobVertexID, ArchivedExecutionJobVertex> archivedTasks = new HashMap<>(numberVertices); List<ArchivedExecutionJobVertex> archivedVerticesInCreationOrder = new ArrayL...
ArchivedExecutionGraph implements AccessExecutionGraph, Serializable { public static ArchivedExecutionGraph createFrom(ExecutionGraph executionGraph) { final int numberVertices = executionGraph.getTotalNumberOfVertices(); Map<JobVertexID, ArchivedExecutionJobVertex> archivedTasks = new HashMap<>(numberVertices); List<A...
ArchivedExecutionGraph implements AccessExecutionGraph, Serializable { public static ArchivedExecutionGraph createFrom(ExecutionGraph executionGraph) { final int numberVertices = executionGraph.getTotalNumberOfVertices(); Map<JobVertexID, ArchivedExecutionJobVertex> archivedTasks = new HashMap<>(numberVertices); List<A...
ArchivedExecutionGraph implements AccessExecutionGraph, Serializable { public static ArchivedExecutionGraph createFrom(ExecutionGraph executionGraph) { final int numberVertices = executionGraph.getTotalNumberOfVertices(); Map<JobVertexID, ArchivedExecutionJobVertex> archivedTasks = new HashMap<>(numberVertices); List<A...
ArchivedExecutionGraph implements AccessExecutionGraph, Serializable { public static ArchivedExecutionGraph createFrom(ExecutionGraph executionGraph) { final int numberVertices = executionGraph.getTotalNumberOfVertices(); Map<JobVertexID, ArchivedExecutionJobVertex> archivedTasks = new HashMap<>(numberVertices); List<A...
@Test public void testSerialization() throws IOException, ClassNotFoundException { ArchivedExecutionGraph archivedGraph = ArchivedExecutionGraph.createFrom(runtimeGraph); verifySerializability(archivedGraph); }
public static ArchivedExecutionGraph createFrom(ExecutionGraph executionGraph) { final int numberVertices = executionGraph.getTotalNumberOfVertices(); Map<JobVertexID, ArchivedExecutionJobVertex> archivedTasks = new HashMap<>(numberVertices); List<ArchivedExecutionJobVertex> archivedVerticesInCreationOrder = new ArrayL...
ArchivedExecutionGraph implements AccessExecutionGraph, Serializable { public static ArchivedExecutionGraph createFrom(ExecutionGraph executionGraph) { final int numberVertices = executionGraph.getTotalNumberOfVertices(); Map<JobVertexID, ArchivedExecutionJobVertex> archivedTasks = new HashMap<>(numberVertices); List<A...
ArchivedExecutionGraph implements AccessExecutionGraph, Serializable { public static ArchivedExecutionGraph createFrom(ExecutionGraph executionGraph) { final int numberVertices = executionGraph.getTotalNumberOfVertices(); Map<JobVertexID, ArchivedExecutionJobVertex> archivedTasks = new HashMap<>(numberVertices); List<A...
ArchivedExecutionGraph implements AccessExecutionGraph, Serializable { public static ArchivedExecutionGraph createFrom(ExecutionGraph executionGraph) { final int numberVertices = executionGraph.getTotalNumberOfVertices(); Map<JobVertexID, ArchivedExecutionJobVertex> archivedTasks = new HashMap<>(numberVertices); List<A...
ArchivedExecutionGraph implements AccessExecutionGraph, Serializable { public static ArchivedExecutionGraph createFrom(ExecutionGraph executionGraph) { final int numberVertices = executionGraph.getTotalNumberOfVertices(); Map<JobVertexID, ArchivedExecutionJobVertex> archivedTasks = new HashMap<>(numberVertices); List<A...
@Test public void mkdirs() throws Exception { File folderRoot = temporaryFolder.getRoot(); File newFolder = new File(folderRoot, String.valueOf(UUID.randomUUID())); File innerNewFolder = new File(newFolder, String.valueOf(UUID.randomUUID())); Path path = new Path(innerNewFolder.toURI()); Assert.assertFalse(newFolder.is...
public boolean mkdirs() throws IOException { return fileSystem.mkdirs(directory); }
SnapshotDirectory { public boolean mkdirs() throws IOException { return fileSystem.mkdirs(directory); } }
SnapshotDirectory { public boolean mkdirs() throws IOException { return fileSystem.mkdirs(directory); } private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private SnapshotDirectory(@Nonnull Path directory); }
SnapshotDirectory { public boolean mkdirs() throws IOException { return fileSystem.mkdirs(directory); } private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private SnapshotDirectory(@Nonnull Path directory); @Nonnull Path getDirectory(); boolean mkdirs(); @Nonnull FileSystem getFileSys...
SnapshotDirectory { public boolean mkdirs() throws IOException { return fileSystem.mkdirs(directory); } private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private SnapshotDirectory(@Nonnull Path directory); @Nonnull Path getDirectory(); boolean mkdirs(); @Nonnull FileSystem getFileSys...
@Test public void exists() throws Exception { File folderRoot = temporaryFolder.getRoot(); File folderA = new File(folderRoot, String.valueOf(UUID.randomUUID())); Assert.assertFalse(folderA.isDirectory()); Path path = new Path(folderA.toURI()); SnapshotDirectory snapshotDirectory = SnapshotDirectory.permanent(path); As...
public boolean exists() throws IOException { return fileSystem.exists(directory); }
SnapshotDirectory { public boolean exists() throws IOException { return fileSystem.exists(directory); } }
SnapshotDirectory { public boolean exists() throws IOException { return fileSystem.exists(directory); } private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private SnapshotDirectory(@Nonnull Path directory); }
SnapshotDirectory { public boolean exists() throws IOException { return fileSystem.exists(directory); } private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private SnapshotDirectory(@Nonnull Path directory); @Nonnull Path getDirectory(); boolean mkdirs(); @Nonnull FileSystem getFileSys...
SnapshotDirectory { public boolean exists() throws IOException { return fileSystem.exists(directory); } private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private SnapshotDirectory(@Nonnull Path directory); @Nonnull Path getDirectory(); boolean mkdirs(); @Nonnull FileSystem getFileSys...
@Test public void listStatus() throws Exception { File folderRoot = temporaryFolder.getRoot(); File folderA = new File(folderRoot, String.valueOf(UUID.randomUUID())); File folderB = new File(folderA, String.valueOf(UUID.randomUUID())); Assert.assertTrue(folderB.mkdirs()); File file = new File(folderA, "test.txt"); Asse...
public FileStatus[] listStatus() throws IOException { return fileSystem.listStatus(directory); }
SnapshotDirectory { public FileStatus[] listStatus() throws IOException { return fileSystem.listStatus(directory); } }
SnapshotDirectory { public FileStatus[] listStatus() throws IOException { return fileSystem.listStatus(directory); } private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private SnapshotDirectory(@Nonnull Path directory); }
SnapshotDirectory { public FileStatus[] listStatus() throws IOException { return fileSystem.listStatus(directory); } private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private SnapshotDirectory(@Nonnull Path directory); @Nonnull Path getDirectory(); boolean mkdirs(); @Nonnull FileSyst...
SnapshotDirectory { public FileStatus[] listStatus() throws IOException { return fileSystem.listStatus(directory); } private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private SnapshotDirectory(@Nonnull Path directory); @Nonnull Path getDirectory(); boolean mkdirs(); @Nonnull FileSyst...
@Test public void completeSnapshotAndGetHandle() throws Exception { File folderRoot = temporaryFolder.getRoot(); File folderA = new File(folderRoot, String.valueOf(UUID.randomUUID())); Assert.assertTrue(folderA.mkdirs()); Path folderAPath = new Path(folderA.toURI()); SnapshotDirectory snapshotDirectory = SnapshotDirect...
@Nullable public abstract DirectoryStateHandle completeSnapshotAndGetHandle() throws IOException;
SnapshotDirectory { @Nullable public abstract DirectoryStateHandle completeSnapshotAndGetHandle() throws IOException; }
SnapshotDirectory { @Nullable public abstract DirectoryStateHandle completeSnapshotAndGetHandle() throws IOException; private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private SnapshotDirectory(@Nonnull Path directory); }
SnapshotDirectory { @Nullable public abstract DirectoryStateHandle completeSnapshotAndGetHandle() throws IOException; private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private SnapshotDirectory(@Nonnull Path directory); @Nonnull Path getDirectory(); boolean mkdirs(); @Nonnull FileSys...
SnapshotDirectory { @Nullable public abstract DirectoryStateHandle completeSnapshotAndGetHandle() throws IOException; private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private SnapshotDirectory(@Nonnull Path directory); @Nonnull Path getDirectory(); boolean mkdirs(); @Nonnull FileSys...
@Test public void temporary() throws Exception { File folderRoot = temporaryFolder.getRoot(); File folder = new File(folderRoot, String.valueOf(UUID.randomUUID())); Assert.assertTrue(folder.mkdirs()); Path folderPath = new Path(folder.toURI()); SnapshotDirectory tmpSnapshotDirectory = SnapshotDirectory.temporary(folder...
public static SnapshotDirectory temporary(@Nonnull Path directory) throws IOException { return new TemporarySnapshotDirectory(directory); }
SnapshotDirectory { public static SnapshotDirectory temporary(@Nonnull Path directory) throws IOException { return new TemporarySnapshotDirectory(directory); } }
SnapshotDirectory { public static SnapshotDirectory temporary(@Nonnull Path directory) throws IOException { return new TemporarySnapshotDirectory(directory); } private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private SnapshotDirectory(@Nonnull Path directory); }
SnapshotDirectory { public static SnapshotDirectory temporary(@Nonnull Path directory) throws IOException { return new TemporarySnapshotDirectory(directory); } private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private SnapshotDirectory(@Nonnull Path directory); @Nonnull Path getDirec...
SnapshotDirectory { public static SnapshotDirectory temporary(@Nonnull Path directory) throws IOException { return new TemporarySnapshotDirectory(directory); } private SnapshotDirectory(@Nonnull Path directory, @Nonnull FileSystem fileSystem); private SnapshotDirectory(@Nonnull Path directory); @Nonnull Path getDirec...
@Test public void testTaskOwnedStateStream() throws Exception { final List<String> state = Arrays.asList("Flopsy", "Mopsy", "Cotton Tail", "Peter"); final FsCheckpointStorage storage = new FsCheckpointStorage( Path.fromLocalFile(tmp.newFolder()), null, new JobID(), 10); final StreamStateHandle stateHandle; try (Checkpo...
@Override public CheckpointStateOutputStream createTaskOwnedStateStream() throws IOException { return new FsCheckpointStateOutputStream( taskOwnedStateDirectory, fileSystem, FsCheckpointStreamFactory.DEFAULT_WRITE_BUFFER_SIZE, fileSizeThreshold); }
FsCheckpointStorage extends AbstractFsCheckpointStorage { @Override public CheckpointStateOutputStream createTaskOwnedStateStream() throws IOException { return new FsCheckpointStateOutputStream( taskOwnedStateDirectory, fileSystem, FsCheckpointStreamFactory.DEFAULT_WRITE_BUFFER_SIZE, fileSizeThreshold); } }
FsCheckpointStorage extends AbstractFsCheckpointStorage { @Override public CheckpointStateOutputStream createTaskOwnedStateStream() throws IOException { return new FsCheckpointStateOutputStream( taskOwnedStateDirectory, fileSystem, FsCheckpointStreamFactory.DEFAULT_WRITE_BUFFER_SIZE, fileSizeThreshold); } FsCheckpointS...
FsCheckpointStorage extends AbstractFsCheckpointStorage { @Override public CheckpointStateOutputStream createTaskOwnedStateStream() throws IOException { return new FsCheckpointStateOutputStream( taskOwnedStateDirectory, fileSystem, FsCheckpointStreamFactory.DEFAULT_WRITE_BUFFER_SIZE, fileSizeThreshold); } FsCheckpointS...
FsCheckpointStorage extends AbstractFsCheckpointStorage { @Override public CheckpointStateOutputStream createTaskOwnedStateStream() throws IOException { return new FsCheckpointStateOutputStream( taskOwnedStateDirectory, fileSystem, FsCheckpointStreamFactory.DEFAULT_WRITE_BUFFER_SIZE, fileSizeThreshold); } FsCheckpointS...
@Test public void testDisposeDeletesFile() throws Exception { File file = tempFolder.newFile(); writeTestData(file); assertTrue(file.exists()); FileStateHandle handle = new FileStateHandle(Path.fromLocalFile(file), file.length()); handle.discardState(); assertFalse(file.exists()); }
@Override public void discardState() throws Exception { FileSystem fs = getFileSystem(); fs.delete(filePath, false); }
FileStateHandle implements StreamStateHandle { @Override public void discardState() throws Exception { FileSystem fs = getFileSystem(); fs.delete(filePath, false); } }
FileStateHandle implements StreamStateHandle { @Override public void discardState() throws Exception { FileSystem fs = getFileSystem(); fs.delete(filePath, false); } FileStateHandle(Path filePath, long stateSize); }
FileStateHandle implements StreamStateHandle { @Override public void discardState() throws Exception { FileSystem fs = getFileSystem(); fs.delete(filePath, false); } FileStateHandle(Path filePath, long stateSize); Path getFilePath(); @Override FSDataInputStream openInputStream(); @Override void discardState(); @Overrid...
FileStateHandle implements StreamStateHandle { @Override public void discardState() throws Exception { FileSystem fs = getFileSystem(); fs.delete(filePath, false); } FileStateHandle(Path filePath, long stateSize); Path getFilePath(); @Override FSDataInputStream openInputStream(); @Override void discardState(); @Overrid...
@Test public void testDisposeDoesNotDeleteParentDirectory() throws Exception { File parentDir = tempFolder.newFolder(); assertTrue(parentDir.exists()); File file = new File(parentDir, "test"); writeTestData(file); assertTrue(file.exists()); FileStateHandle handle = new FileStateHandle(Path.fromLocalFile(file), file.len...
@Override public void discardState() throws Exception { FileSystem fs = getFileSystem(); fs.delete(filePath, false); }
FileStateHandle implements StreamStateHandle { @Override public void discardState() throws Exception { FileSystem fs = getFileSystem(); fs.delete(filePath, false); } }
FileStateHandle implements StreamStateHandle { @Override public void discardState() throws Exception { FileSystem fs = getFileSystem(); fs.delete(filePath, false); } FileStateHandle(Path filePath, long stateSize); }
FileStateHandle implements StreamStateHandle { @Override public void discardState() throws Exception { FileSystem fs = getFileSystem(); fs.delete(filePath, false); } FileStateHandle(Path filePath, long stateSize); Path getFilePath(); @Override FSDataInputStream openInputStream(); @Override void discardState(); @Overrid...
FileStateHandle implements StreamStateHandle { @Override public void discardState() throws Exception { FileSystem fs = getFileSystem(); fs.delete(filePath, false); } FileStateHandle(Path filePath, long stateSize); Path getFilePath(); @Override FSDataInputStream openInputStream(); @Override void discardState(); @Overrid...
@Test public void testForwardingSubtaskLocalStateBaseDirFromLocalStateStore() throws IOException { JobID jobID = new JobID(42L, 43L); AllocationID allocationID = new AllocationID(4711L, 23L); JobVertexID jobVertexID = new JobVertexID(12L, 34L); ExecutionAttemptID executionAttemptID = new ExecutionAttemptID(23L, 24L); T...
@Nonnull @Override public LocalRecoveryConfig createLocalRecoveryConfig() { return localStateStore.getLocalRecoveryConfig(); }
TaskStateManagerImpl implements TaskStateManager { @Nonnull @Override public LocalRecoveryConfig createLocalRecoveryConfig() { return localStateStore.getLocalRecoveryConfig(); } }
TaskStateManagerImpl implements TaskStateManager { @Nonnull @Override public LocalRecoveryConfig createLocalRecoveryConfig() { return localStateStore.getLocalRecoveryConfig(); } TaskStateManagerImpl( @Nonnull JobID jobId, @Nonnull ExecutionAttemptID executionAttemptID, @Nonnull TaskLocalStateStore localStateStore...
TaskStateManagerImpl implements TaskStateManager { @Nonnull @Override public LocalRecoveryConfig createLocalRecoveryConfig() { return localStateStore.getLocalRecoveryConfig(); } TaskStateManagerImpl( @Nonnull JobID jobId, @Nonnull ExecutionAttemptID executionAttemptID, @Nonnull TaskLocalStateStore localStateStore...
TaskStateManagerImpl implements TaskStateManager { @Nonnull @Override public LocalRecoveryConfig createLocalRecoveryConfig() { return localStateStore.getLocalRecoveryConfig(); } TaskStateManagerImpl( @Nonnull JobID jobId, @Nonnull ExecutionAttemptID executionAttemptID, @Nonnull TaskLocalStateStore localStateStore...
@Test public void testUnknownMatchesUnknown() { assertTrue(ResourceProfile.UNKNOWN.isMatching(ResourceProfile.UNKNOWN)); }
public boolean isMatching(ResourceProfile required) { if (cpuCores >= required.getCpuCores() && heapMemoryInMB >= required.getHeapMemoryInMB() && directMemoryInMB >= required.getDirectMemoryInMB() && nativeMemoryInMB >= required.getNativeMemoryInMB() && networkMemoryInMB >= required.getNetworkMemoryInMB()) { for (Map.E...
ResourceProfile implements Serializable, Comparable<ResourceProfile> { public boolean isMatching(ResourceProfile required) { if (cpuCores >= required.getCpuCores() && heapMemoryInMB >= required.getHeapMemoryInMB() && directMemoryInMB >= required.getDirectMemoryInMB() && nativeMemoryInMB >= required.getNativeMemoryInMB(...
ResourceProfile implements Serializable, Comparable<ResourceProfile> { public boolean isMatching(ResourceProfile required) { if (cpuCores >= required.getCpuCores() && heapMemoryInMB >= required.getHeapMemoryInMB() && directMemoryInMB >= required.getDirectMemoryInMB() && nativeMemoryInMB >= required.getNativeMemoryInMB(...
ResourceProfile implements Serializable, Comparable<ResourceProfile> { public boolean isMatching(ResourceProfile required) { if (cpuCores >= required.getCpuCores() && heapMemoryInMB >= required.getHeapMemoryInMB() && directMemoryInMB >= required.getDirectMemoryInMB() && nativeMemoryInMB >= required.getNativeMemoryInMB(...
ResourceProfile implements Serializable, Comparable<ResourceProfile> { public boolean isMatching(ResourceProfile required) { if (cpuCores >= required.getCpuCores() && heapMemoryInMB >= required.getHeapMemoryInMB() && directMemoryInMB >= required.getDirectMemoryInMB() && nativeMemoryInMB >= required.getNativeMemoryInMB(...
@Test public void testEquals() throws Exception { ResourceSpec rs1 = ResourceSpec.newBuilder().setCpuCores(1.0).setHeapMemoryInMB(100).build(); ResourceSpec rs2 = ResourceSpec.newBuilder().setCpuCores(1.0).setHeapMemoryInMB(100).build(); assertTrue(ResourceProfile.fromResourceSpec(rs1, 0).equals(ResourceProfile.fromRes...
@Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj != null && obj.getClass() == ResourceProfile.class) { ResourceProfile that = (ResourceProfile) obj; return this.cpuCores == that.cpuCores && this.heapMemoryInMB == that.heapMemoryInMB && this.directMemoryInMB == that.directMemo...
ResourceProfile implements Serializable, Comparable<ResourceProfile> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj != null && obj.getClass() == ResourceProfile.class) { ResourceProfile that = (ResourceProfile) obj; return this.cpuCores == that.cpuCores && this.heapMemory...
ResourceProfile implements Serializable, Comparable<ResourceProfile> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj != null && obj.getClass() == ResourceProfile.class) { ResourceProfile that = (ResourceProfile) obj; return this.cpuCores == that.cpuCores && this.heapMemory...
ResourceProfile implements Serializable, Comparable<ResourceProfile> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj != null && obj.getClass() == ResourceProfile.class) { ResourceProfile that = (ResourceProfile) obj; return this.cpuCores == that.cpuCores && this.heapMemory...
ResourceProfile implements Serializable, Comparable<ResourceProfile> { @Override public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj != null && obj.getClass() == ResourceProfile.class) { ResourceProfile that = (ResourceProfile) obj; return this.cpuCores == that.cpuCores && this.heapMemory...
@Test public void testCompareTo() throws Exception { ResourceSpec rs1 = ResourceSpec.newBuilder().setCpuCores(1.0).setHeapMemoryInMB(100).build(); ResourceSpec rs2 = ResourceSpec.newBuilder().setCpuCores(1.0).setHeapMemoryInMB(100).build(); assertEquals(0, ResourceProfile.fromResourceSpec(rs1, 0).compareTo(ResourceProf...
@Override public int compareTo(@Nonnull ResourceProfile other) { int cmp = Integer.compare(this.getMemoryInMB(), other.getMemoryInMB()); if (cmp == 0) { cmp = Double.compare(this.cpuCores, other.cpuCores); } if (cmp == 0) { Iterator<Map.Entry<String, Resource>> thisIterator = extendedResources.entrySet().iterator(); It...
ResourceProfile implements Serializable, Comparable<ResourceProfile> { @Override public int compareTo(@Nonnull ResourceProfile other) { int cmp = Integer.compare(this.getMemoryInMB(), other.getMemoryInMB()); if (cmp == 0) { cmp = Double.compare(this.cpuCores, other.cpuCores); } if (cmp == 0) { Iterator<Map.Entry<String...
ResourceProfile implements Serializable, Comparable<ResourceProfile> { @Override public int compareTo(@Nonnull ResourceProfile other) { int cmp = Integer.compare(this.getMemoryInMB(), other.getMemoryInMB()); if (cmp == 0) { cmp = Double.compare(this.cpuCores, other.cpuCores); } if (cmp == 0) { Iterator<Map.Entry<String...
ResourceProfile implements Serializable, Comparable<ResourceProfile> { @Override public int compareTo(@Nonnull ResourceProfile other) { int cmp = Integer.compare(this.getMemoryInMB(), other.getMemoryInMB()); if (cmp == 0) { cmp = Double.compare(this.cpuCores, other.cpuCores); } if (cmp == 0) { Iterator<Map.Entry<String...
ResourceProfile implements Serializable, Comparable<ResourceProfile> { @Override public int compareTo(@Nonnull ResourceProfile other) { int cmp = Integer.compare(this.getMemoryInMB(), other.getMemoryInMB()); if (cmp == 0) { cmp = Double.compare(this.cpuCores, other.cpuCores); } if (cmp == 0) { Iterator<Map.Entry<String...
@Test public void testCalculateCutoffMB() { Configuration config = new Configuration(); long containerMemoryMB = 1000L; config.setFloat(ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_RATIO, 0.1f); config.setInteger(ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_MIN, 128); assertEquals(128, ContaineredTaskManagerPar...
public static long calculateCutoffMB(Configuration config, long containerMemoryMB) { Preconditions.checkArgument(containerMemoryMB > 0); final float memoryCutoffRatio = config.getFloat( ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_RATIO); if (memoryCutoffRatio >= 1 || memoryCutoffRatio <= 0) { throw new IllegalArgu...
ContaineredTaskManagerParameters implements java.io.Serializable { public static long calculateCutoffMB(Configuration config, long containerMemoryMB) { Preconditions.checkArgument(containerMemoryMB > 0); final float memoryCutoffRatio = config.getFloat( ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_RATIO); if (memory...
ContaineredTaskManagerParameters implements java.io.Serializable { public static long calculateCutoffMB(Configuration config, long containerMemoryMB) { Preconditions.checkArgument(containerMemoryMB > 0); final float memoryCutoffRatio = config.getFloat( ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_RATIO); if (memory...
ContaineredTaskManagerParameters implements java.io.Serializable { public static long calculateCutoffMB(Configuration config, long containerMemoryMB) { Preconditions.checkArgument(containerMemoryMB > 0); final float memoryCutoffRatio = config.getFloat( ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_RATIO); if (memory...
ContaineredTaskManagerParameters implements java.io.Serializable { public static long calculateCutoffMB(Configuration config, long containerMemoryMB) { Preconditions.checkArgument(containerMemoryMB > 0); final float memoryCutoffRatio = config.getFloat( ResourceManagerOptions.CONTAINERIZED_HEAP_CUTOFF_RATIO); if (memory...
@SuppressWarnings("deprecation") @Test public void calculateNetworkBufOld() { Configuration config = new Configuration(); config.setInteger(TaskManagerOptions.NETWORK_NUM_BUFFERS, 1); assertEquals(TaskManagerOptions.MEMORY_SEGMENT_SIZE.defaultValue().longValue(), TaskManagerServices.calculateNetworkBufferMemory(10L << ...
@SuppressWarnings("deprecation") public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) { Preconditions.checkArgument(totalJavaMemorySize > 0); int segmentSize = config.getInteger(TaskManagerOptions.MEMORY_SEGMENT_SIZE); final long networkBufBytes; if (TaskManagerServicesConfigu...
TaskManagerServices { @SuppressWarnings("deprecation") public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) { Preconditions.checkArgument(totalJavaMemorySize > 0); int segmentSize = config.getInteger(TaskManagerOptions.MEMORY_SEGMENT_SIZE); final long networkBufBytes; if (Task...
TaskManagerServices { @SuppressWarnings("deprecation") public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) { Preconditions.checkArgument(totalJavaMemorySize > 0); int segmentSize = config.getInteger(TaskManagerOptions.MEMORY_SEGMENT_SIZE); final long networkBufBytes; if (Task...
TaskManagerServices { @SuppressWarnings("deprecation") public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) { Preconditions.checkArgument(totalJavaMemorySize > 0); int segmentSize = config.getInteger(TaskManagerOptions.MEMORY_SEGMENT_SIZE); final long networkBufBytes; if (Task...
TaskManagerServices { @SuppressWarnings("deprecation") public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) { Preconditions.checkArgument(totalJavaMemorySize > 0); int segmentSize = config.getInteger(TaskManagerOptions.MEMORY_SEGMENT_SIZE); final long networkBufBytes; if (Task...
@Test public void calculateNetworkBufNew() throws Exception { Configuration config = new Configuration(); final Float defaultFrac = TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION.defaultValue(); final Long defaultMin = TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN.defaultValue(); final Long defaultMax = TaskManager...
@SuppressWarnings("deprecation") public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) { Preconditions.checkArgument(totalJavaMemorySize > 0); int segmentSize = config.getInteger(TaskManagerOptions.MEMORY_SEGMENT_SIZE); final long networkBufBytes; if (TaskManagerServicesConfigu...
TaskManagerServices { @SuppressWarnings("deprecation") public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) { Preconditions.checkArgument(totalJavaMemorySize > 0); int segmentSize = config.getInteger(TaskManagerOptions.MEMORY_SEGMENT_SIZE); final long networkBufBytes; if (Task...
TaskManagerServices { @SuppressWarnings("deprecation") public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) { Preconditions.checkArgument(totalJavaMemorySize > 0); int segmentSize = config.getInteger(TaskManagerOptions.MEMORY_SEGMENT_SIZE); final long networkBufBytes; if (Task...
TaskManagerServices { @SuppressWarnings("deprecation") public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) { Preconditions.checkArgument(totalJavaMemorySize > 0); int segmentSize = config.getInteger(TaskManagerOptions.MEMORY_SEGMENT_SIZE); final long networkBufBytes; if (Task...
TaskManagerServices { @SuppressWarnings("deprecation") public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) { Preconditions.checkArgument(totalJavaMemorySize > 0); int segmentSize = config.getInteger(TaskManagerOptions.MEMORY_SEGMENT_SIZE); final long networkBufBytes; if (Task...
@SuppressWarnings("deprecation") @Test public void calculateNetworkBufMixed() throws Exception { Configuration config = new Configuration(); config.setInteger(TaskManagerOptions.NETWORK_NUM_BUFFERS, 1); final Float defaultFrac = TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION.defaultValue(); final Long defaultMin = ...
@SuppressWarnings("deprecation") public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) { Preconditions.checkArgument(totalJavaMemorySize > 0); int segmentSize = config.getInteger(TaskManagerOptions.MEMORY_SEGMENT_SIZE); final long networkBufBytes; if (TaskManagerServicesConfigu...
TaskManagerServices { @SuppressWarnings("deprecation") public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) { Preconditions.checkArgument(totalJavaMemorySize > 0); int segmentSize = config.getInteger(TaskManagerOptions.MEMORY_SEGMENT_SIZE); final long networkBufBytes; if (Task...
TaskManagerServices { @SuppressWarnings("deprecation") public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) { Preconditions.checkArgument(totalJavaMemorySize > 0); int segmentSize = config.getInteger(TaskManagerOptions.MEMORY_SEGMENT_SIZE); final long networkBufBytes; if (Task...
TaskManagerServices { @SuppressWarnings("deprecation") public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) { Preconditions.checkArgument(totalJavaMemorySize > 0); int segmentSize = config.getInteger(TaskManagerOptions.MEMORY_SEGMENT_SIZE); final long networkBufBytes; if (Task...
TaskManagerServices { @SuppressWarnings("deprecation") public static long calculateNetworkBufferMemory(long totalJavaMemorySize, Configuration config) { Preconditions.checkArgument(totalJavaMemorySize > 0); int segmentSize = config.getInteger(TaskManagerOptions.MEMORY_SEGMENT_SIZE); final long networkBufBytes; if (Task...
@Test public void calculateHeapSizeMB() throws Exception { Configuration config = new Configuration(); config.setFloat(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION, 0.1f); config.setLong(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN, 64L << 20); config.setLong(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MAX, 1L << ...
public static long calculateHeapSizeMB(long totalJavaMemorySizeMB, Configuration config) { Preconditions.checkArgument(totalJavaMemorySizeMB > 0); final long networkBufMB = calculateNetworkBufferMemory( totalJavaMemorySizeMB << 20, config) >> 20; final long remainingJavaMemorySizeMB = totalJavaMemorySizeMB - networkBuf...
TaskManagerServices { public static long calculateHeapSizeMB(long totalJavaMemorySizeMB, Configuration config) { Preconditions.checkArgument(totalJavaMemorySizeMB > 0); final long networkBufMB = calculateNetworkBufferMemory( totalJavaMemorySizeMB << 20, config) >> 20; final long remainingJavaMemorySizeMB = totalJavaMem...
TaskManagerServices { public static long calculateHeapSizeMB(long totalJavaMemorySizeMB, Configuration config) { Preconditions.checkArgument(totalJavaMemorySizeMB > 0); final long networkBufMB = calculateNetworkBufferMemory( totalJavaMemorySizeMB << 20, config) >> 20; final long remainingJavaMemorySizeMB = totalJavaMem...
TaskManagerServices { public static long calculateHeapSizeMB(long totalJavaMemorySizeMB, Configuration config) { Preconditions.checkArgument(totalJavaMemorySizeMB > 0); final long networkBufMB = calculateNetworkBufferMemory( totalJavaMemorySizeMB << 20, config) >> 20; final long remainingJavaMemorySizeMB = totalJavaMem...
TaskManagerServices { public static long calculateHeapSizeMB(long totalJavaMemorySizeMB, Configuration config) { Preconditions.checkArgument(totalJavaMemorySizeMB > 0); final long networkBufMB = calculateNetworkBufferMemory( totalJavaMemorySizeMB << 20, config) >> 20; final long remainingJavaMemorySizeMB = totalJavaMem...
@SuppressWarnings("deprecation") @Test public void hasNewNetworkBufConfOld() throws Exception { Configuration config = new Configuration(); config.setInteger(TaskManagerOptions.NETWORK_NUM_BUFFERS, 1); assertFalse(TaskManagerServicesConfiguration.hasNewNetworkBufConf(config)); }
@SuppressWarnings("deprecation") public static boolean hasNewNetworkBufConf(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MAX) || !con...
TaskManagerServicesConfiguration { @SuppressWarnings("deprecation") public static boolean hasNewNetworkBufConf(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions....
TaskManagerServicesConfiguration { @SuppressWarnings("deprecation") public static boolean hasNewNetworkBufConf(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions....
TaskManagerServicesConfiguration { @SuppressWarnings("deprecation") public static boolean hasNewNetworkBufConf(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions....
TaskManagerServicesConfiguration { @SuppressWarnings("deprecation") public static boolean hasNewNetworkBufConf(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions....
@Test public void hasNewNetworkBufConfNew() throws Exception { Configuration config = new Configuration(); assertTrue(TaskManagerServicesConfiguration.hasNewNetworkBufConf(config)); config.setFloat(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION, 0.1f); config.setLong(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN, 1...
@SuppressWarnings("deprecation") public static boolean hasNewNetworkBufConf(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MAX) || !con...
TaskManagerServicesConfiguration { @SuppressWarnings("deprecation") public static boolean hasNewNetworkBufConf(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions....
TaskManagerServicesConfiguration { @SuppressWarnings("deprecation") public static boolean hasNewNetworkBufConf(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions....
TaskManagerServicesConfiguration { @SuppressWarnings("deprecation") public static boolean hasNewNetworkBufConf(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions....
TaskManagerServicesConfiguration { @SuppressWarnings("deprecation") public static boolean hasNewNetworkBufConf(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions....
@SuppressWarnings("deprecation") @Test public void hasNewNetworkBufConfMixed() throws Exception { Configuration config = new Configuration(); assertTrue(TaskManagerServicesConfiguration.hasNewNetworkBufConf(config)); config.setInteger(TaskManagerOptions.NETWORK_NUM_BUFFERS, 1); assertFalse(TaskManagerServicesConfigurat...
@SuppressWarnings("deprecation") public static boolean hasNewNetworkBufConf(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MAX) || !con...
TaskManagerServicesConfiguration { @SuppressWarnings("deprecation") public static boolean hasNewNetworkBufConf(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions....
TaskManagerServicesConfiguration { @SuppressWarnings("deprecation") public static boolean hasNewNetworkBufConf(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions....
TaskManagerServicesConfiguration { @SuppressWarnings("deprecation") public static boolean hasNewNetworkBufConf(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions....
TaskManagerServicesConfiguration { @SuppressWarnings("deprecation") public static boolean hasNewNetworkBufConf(final Configuration config) { return config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_FRACTION) || config.contains(TaskManagerOptions.NETWORK_BUFFERS_MEMORY_MIN) || config.contains(TaskManagerOptions....
@Test public void testFilterOutDuplicateJobMasterRegistrations() throws Exception { final long verificationTimeout = 500L; final JobLeaderService jobLeaderService = mock(JobLeaderService.class); final HeartbeatServices heartbeatServicesMock = mock(HeartbeatServices.class, Mockito.RETURNS_MOCKS); final JobMasterGateway ...
@Override public void start() throws Exception { super.start(); try { resourceManagerLeaderRetriever.start(new ResourceManagerLeaderListener()); } catch (Exception e) { onFatalError(e); } taskSlotTable.start(new SlotActionsImpl()); jobLeaderService.start(getAddress(), getRpcService(), haServices, new JobLeaderListenerI...
TaskExecutor extends RpcEndpoint implements TaskExecutorGateway { @Override public void start() throws Exception { super.start(); try { resourceManagerLeaderRetriever.start(new ResourceManagerLeaderListener()); } catch (Exception e) { onFatalError(e); } taskSlotTable.start(new SlotActionsImpl()); jobLeaderService.start...
TaskExecutor extends RpcEndpoint implements TaskExecutorGateway { @Override public void start() throws Exception { super.start(); try { resourceManagerLeaderRetriever.start(new ResourceManagerLeaderListener()); } catch (Exception e) { onFatalError(e); } taskSlotTable.start(new SlotActionsImpl()); jobLeaderService.start...
TaskExecutor extends RpcEndpoint implements TaskExecutorGateway { @Override public void start() throws Exception { super.start(); try { resourceManagerLeaderRetriever.start(new ResourceManagerLeaderListener()); } catch (Exception e) { onFatalError(e); } taskSlotTable.start(new SlotActionsImpl()); jobLeaderService.start...
TaskExecutor extends RpcEndpoint implements TaskExecutorGateway { @Override public void start() throws Exception { super.start(); try { resourceManagerLeaderRetriever.start(new ResourceManagerLeaderListener()); } catch (Exception e) { onFatalError(e); } taskSlotTable.start(new SlotActionsImpl()); jobLeaderService.start...
@Test public void testRMHeartbeatStopWhenLeadershipRevoked() throws Exception { final long heartbeatInterval = 1L; final long heartbeatTimeout = 10000L; final long pollTimeout = 1000L; final RecordingHeartbeatServices heartbeatServices = new RecordingHeartbeatServices(heartbeatInterval, heartbeatTimeout); final Resourc...
@Override public void start() throws Exception { super.start(); try { resourceManagerLeaderRetriever.start(new ResourceManagerLeaderListener()); } catch (Exception e) { onFatalError(e); } taskSlotTable.start(new SlotActionsImpl()); jobLeaderService.start(getAddress(), getRpcService(), haServices, new JobLeaderListenerI...
TaskExecutor extends RpcEndpoint implements TaskExecutorGateway { @Override public void start() throws Exception { super.start(); try { resourceManagerLeaderRetriever.start(new ResourceManagerLeaderListener()); } catch (Exception e) { onFatalError(e); } taskSlotTable.start(new SlotActionsImpl()); jobLeaderService.start...
TaskExecutor extends RpcEndpoint implements TaskExecutorGateway { @Override public void start() throws Exception { super.start(); try { resourceManagerLeaderRetriever.start(new ResourceManagerLeaderListener()); } catch (Exception e) { onFatalError(e); } taskSlotTable.start(new SlotActionsImpl()); jobLeaderService.start...
TaskExecutor extends RpcEndpoint implements TaskExecutorGateway { @Override public void start() throws Exception { super.start(); try { resourceManagerLeaderRetriever.start(new ResourceManagerLeaderListener()); } catch (Exception e) { onFatalError(e); } taskSlotTable.start(new SlotActionsImpl()); jobLeaderService.start...
TaskExecutor extends RpcEndpoint implements TaskExecutorGateway { @Override public void start() throws Exception { super.start(); try { resourceManagerLeaderRetriever.start(new ResourceManagerLeaderListener()); } catch (Exception e) { onFatalError(e); } taskSlotTable.start(new SlotActionsImpl()); jobLeaderService.start...
@Test public void testMaximumRegistrationDuration() throws Exception { configuration.setString(TaskManagerOptions.REGISTRATION_TIMEOUT, "10 ms"); final TaskExecutor taskExecutor = new TaskExecutor( rpc, TaskManagerConfiguration.fromConfiguration(configuration), haServices, new TaskManagerServicesBuilder().build(), new ...
@Override public void start() throws Exception { super.start(); try { resourceManagerLeaderRetriever.start(new ResourceManagerLeaderListener()); } catch (Exception e) { onFatalError(e); } taskSlotTable.start(new SlotActionsImpl()); jobLeaderService.start(getAddress(), getRpcService(), haServices, new JobLeaderListenerI...
TaskExecutor extends RpcEndpoint implements TaskExecutorGateway { @Override public void start() throws Exception { super.start(); try { resourceManagerLeaderRetriever.start(new ResourceManagerLeaderListener()); } catch (Exception e) { onFatalError(e); } taskSlotTable.start(new SlotActionsImpl()); jobLeaderService.start...
TaskExecutor extends RpcEndpoint implements TaskExecutorGateway { @Override public void start() throws Exception { super.start(); try { resourceManagerLeaderRetriever.start(new ResourceManagerLeaderListener()); } catch (Exception e) { onFatalError(e); } taskSlotTable.start(new SlotActionsImpl()); jobLeaderService.start...
TaskExecutor extends RpcEndpoint implements TaskExecutorGateway { @Override public void start() throws Exception { super.start(); try { resourceManagerLeaderRetriever.start(new ResourceManagerLeaderListener()); } catch (Exception e) { onFatalError(e); } taskSlotTable.start(new SlotActionsImpl()); jobLeaderService.start...
TaskExecutor extends RpcEndpoint implements TaskExecutorGateway { @Override public void start() throws Exception { super.start(); try { resourceManagerLeaderRetriever.start(new ResourceManagerLeaderListener()); } catch (Exception e) { onFatalError(e); } taskSlotTable.start(new SlotActionsImpl()); jobLeaderService.start...
@Test public void testDataSinkTask() { FileReader fr = null; BufferedReader br = null; try { int keyCnt = 100; int valCnt = 20; super.initEnvironment(MEMORY_MANAGER_SIZE, NETWORK_BUFFER_SIZE); super.addInput(new UniformRecordGenerator(keyCnt, valCnt, false), 0); DataSinkTask<Record> testTask = new DataSinkTask<>(this.m...
public DataSinkTask(Environment environment) { super(environment); }
DataSinkTask extends AbstractInvokable { public DataSinkTask(Environment environment) { super(environment); } }
DataSinkTask extends AbstractInvokable { public DataSinkTask(Environment environment) { super(environment); } DataSinkTask(Environment environment); }
DataSinkTask extends AbstractInvokable { public DataSinkTask(Environment environment) { super(environment); } DataSinkTask(Environment environment); @Override void invoke(); @Override void cancel(); DistributedRuntimeUDFContext createRuntimeContext(); }
DataSinkTask extends AbstractInvokable { public DataSinkTask(Environment environment) { super(environment); } DataSinkTask(Environment environment); @Override void invoke(); @Override void cancel(); DistributedRuntimeUDFContext createRuntimeContext(); }
@Test public void testUnionDataSinkTask() { int keyCnt = 10; int valCnt = 20; super.initEnvironment(MEMORY_MANAGER_SIZE, NETWORK_BUFFER_SIZE); final IteratorWrappingTestSingleInputGate<?>[] readers = new IteratorWrappingTestSingleInputGate[4]; readers[0] = super.addInput(new UniformRecordGenerator(keyCnt, valCnt, 0, 0,...
@Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "." : ": " + e.getMessage()), e); } LOG.de...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
@Test @SuppressWarnings("unchecked") public void testSortingDataSinkTask() { int keyCnt = 100; int valCnt = 20; double memoryFraction = 1.0; super.initEnvironment(MEMORY_MANAGER_SIZE, NETWORK_BUFFER_SIZE); super.addInput(new UniformRecordGenerator(keyCnt, valCnt, true), 0); DataSinkTask<Record> testTask = new DataSinkT...
@Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "." : ": " + e.getMessage()), e); } LOG.de...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
@Test public void testFailingDataSinkTask() { int keyCnt = 100; int valCnt = 20; super.initEnvironment(MEMORY_MANAGER_SIZE, NETWORK_BUFFER_SIZE); super.addInput(new UniformRecordGenerator(keyCnt, valCnt, false), 0); DataSinkTask<Record> testTask = new DataSinkTask<>(this.mockEnv); Configuration stubParams = new Configu...
@Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "." : ": " + e.getMessage()), e); } LOG.de...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
@Test @SuppressWarnings("unchecked") public void testFailingSortingDataSinkTask() { int keyCnt = 100; int valCnt = 20; double memoryFraction = 1.0; super.initEnvironment(MEMORY_MANAGER_SIZE, NETWORK_BUFFER_SIZE); super.addInput(new UniformRecordGenerator(keyCnt, valCnt, true), 0); DataSinkTask<Record> testTask = new Da...
@Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "." : ": " + e.getMessage()), e); } LOG.de...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
@Test @SuppressWarnings("unchecked") public void testCancelSortingDataSinkTask() { double memoryFraction = 1.0; super.initEnvironment(MEMORY_MANAGER_SIZE, NETWORK_BUFFER_SIZE); super.addInput(new InfiniteInputIterator(), 0); final DataSinkTask<Record> testTask = new DataSinkTask<>(this.mockEnv); Configuration stubParam...
@Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "." : ": " + e.getMessage()), e); } LOG.de...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
DataSinkTask extends AbstractInvokable { @Override public void invoke() throws Exception { LOG.debug(getLogString("Start registering input and output")); initOutputFormat(); try { initInputReaders(); } catch (Exception e) { throw new RuntimeException("Initializing the input streams failed" + (e.getMessage() == null ? "...
@Test public void testDataSourceTask() { int keyCnt = 100; int valCnt = 20; this.outList = new ArrayList<Record>(); try { InputFilePreparator.prepareInputFile(new UniformRecordGenerator(keyCnt, valCnt, false), this.tempTestPath, true); } catch (IOException e1) { Assert.fail("Unable to set-up test input file"); } super....
public DataSourceTask(Environment environment) { super(environment); }
DataSourceTask extends AbstractInvokable { public DataSourceTask(Environment environment) { super(environment); } }
DataSourceTask extends AbstractInvokable { public DataSourceTask(Environment environment) { super(environment); } DataSourceTask(Environment environment); }
DataSourceTask extends AbstractInvokable { public DataSourceTask(Environment environment) { super(environment); } DataSourceTask(Environment environment); @Override void invoke(); @Override void cancel(); DistributedRuntimeUDFContext createRuntimeContext(); }
DataSourceTask extends AbstractInvokable { public DataSourceTask(Environment environment) { super(environment); } DataSourceTask(Environment environment); @Override void invoke(); @Override void cancel(); DistributedRuntimeUDFContext createRuntimeContext(); }
@Test public void testFailingDataSourceTask() { int keyCnt = 20; int valCnt = 10; this.outList = new NirvanaOutputList(); try { InputFilePreparator.prepareInputFile(new UniformRecordGenerator(keyCnt, valCnt, false), this.tempTestPath, false); } catch (IOException e1) { Assert.fail("Unable to set-up test input file"); }...
@Override public void invoke() throws Exception { initInputFormat(); LOG.debug(getLogString("Start registering input and output")); try { initOutputs(getUserCodeClassLoader()); } catch (Exception ex) { throw new RuntimeException("The initialization of the DataSource's outputs caused an error: " + ex.getMessage(), ex); ...
DataSourceTask extends AbstractInvokable { @Override public void invoke() throws Exception { initInputFormat(); LOG.debug(getLogString("Start registering input and output")); try { initOutputs(getUserCodeClassLoader()); } catch (Exception ex) { throw new RuntimeException("The initialization of the DataSource's outputs ...
DataSourceTask extends AbstractInvokable { @Override public void invoke() throws Exception { initInputFormat(); LOG.debug(getLogString("Start registering input and output")); try { initOutputs(getUserCodeClassLoader()); } catch (Exception ex) { throw new RuntimeException("The initialization of the DataSource's outputs ...
DataSourceTask extends AbstractInvokable { @Override public void invoke() throws Exception { initInputFormat(); LOG.debug(getLogString("Start registering input and output")); try { initOutputs(getUserCodeClassLoader()); } catch (Exception ex) { throw new RuntimeException("The initialization of the DataSource's outputs ...
DataSourceTask extends AbstractInvokable { @Override public void invoke() throws Exception { initInputFormat(); LOG.debug(getLogString("Start registering input and output")); try { initOutputs(getUserCodeClassLoader()); } catch (Exception ex) { throw new RuntimeException("The initialization of the DataSource's outputs ...
@Test public void testCancelDataSourceTask() { int keyCnt = 20; int valCnt = 4; super.initEnvironment(MEMORY_MANAGER_SIZE, NETWORK_BUFFER_SIZE); super.addOutput(new NirvanaOutputList()); try { InputFilePreparator.prepareInputFile(new UniformRecordGenerator(keyCnt, valCnt, false), this.tempTestPath, false); } catch (IOE...
@Override public void invoke() throws Exception { initInputFormat(); LOG.debug(getLogString("Start registering input and output")); try { initOutputs(getUserCodeClassLoader()); } catch (Exception ex) { throw new RuntimeException("The initialization of the DataSource's outputs caused an error: " + ex.getMessage(), ex); ...
DataSourceTask extends AbstractInvokable { @Override public void invoke() throws Exception { initInputFormat(); LOG.debug(getLogString("Start registering input and output")); try { initOutputs(getUserCodeClassLoader()); } catch (Exception ex) { throw new RuntimeException("The initialization of the DataSource's outputs ...
DataSourceTask extends AbstractInvokable { @Override public void invoke() throws Exception { initInputFormat(); LOG.debug(getLogString("Start registering input and output")); try { initOutputs(getUserCodeClassLoader()); } catch (Exception ex) { throw new RuntimeException("The initialization of the DataSource's outputs ...
DataSourceTask extends AbstractInvokable { @Override public void invoke() throws Exception { initInputFormat(); LOG.debug(getLogString("Start registering input and output")); try { initOutputs(getUserCodeClassLoader()); } catch (Exception ex) { throw new RuntimeException("The initialization of the DataSource's outputs ...
DataSourceTask extends AbstractInvokable { @Override public void invoke() throws Exception { initInputFormat(); LOG.debug(getLogString("Start registering input and output")); try { initOutputs(getUserCodeClassLoader()); } catch (Exception ex) { throw new RuntimeException("The initialization of the DataSource's outputs ...
@Test public void testStateTransitions() { try { { SimpleSlot slot = getSlot(); assertTrue(slot.isAlive()); slot.releaseSlot(); assertFalse(slot.isAlive()); assertTrue(slot.isCanceled()); assertTrue(slot.isReleased()); } { SimpleSlot slot = getSlot(); assertTrue(slot.isAlive()); slot.markCancelled(); assertFalse(slot.i...
@Override public CompletableFuture<?> releaseSlot(@Nullable Throwable cause) { if (!isCanceled()) { final CompletableFuture<?> terminationFuture; if (payload != null) { payload.fail(cause != null ? cause : new FlinkException("TaskManager was lost/killed: " + getTaskManagerLocation())); terminationFuture = payload.getTe...
SimpleSlot extends Slot implements LogicalSlot { @Override public CompletableFuture<?> releaseSlot(@Nullable Throwable cause) { if (!isCanceled()) { final CompletableFuture<?> terminationFuture; if (payload != null) { payload.fail(cause != null ? cause : new FlinkException("TaskManager was lost/killed: " + getTaskManag...
SimpleSlot extends Slot implements LogicalSlot { @Override public CompletableFuture<?> releaseSlot(@Nullable Throwable cause) { if (!isCanceled()) { final CompletableFuture<?> terminationFuture; if (payload != null) { payload.fail(cause != null ? cause : new FlinkException("TaskManager was lost/killed: " + getTaskManag...
SimpleSlot extends Slot implements LogicalSlot { @Override public CompletableFuture<?> releaseSlot(@Nullable Throwable cause) { if (!isCanceled()) { final CompletableFuture<?> terminationFuture; if (payload != null) { payload.fail(cause != null ? cause : new FlinkException("TaskManager was lost/killed: " + getTaskManag...
SimpleSlot extends Slot implements LogicalSlot { @Override public CompletableFuture<?> releaseSlot(@Nullable Throwable cause) { if (!isCanceled()) { final CompletableFuture<?> terminationFuture; if (payload != null) { payload.fail(cause != null ? cause : new FlinkException("TaskManager was lost/killed: " + getTaskManag...
@Test public void testCreateSSLClientContext() throws Exception { Configuration clientConfig = new Configuration(); clientConfig.setBoolean(SecurityOptions.SSL_ENABLED, true); clientConfig.setString(SecurityOptions.SSL_TRUSTSTORE, "src/test/resources/local127.truststore"); clientConfig.setString(SecurityOptions.SSL_TRU...
@Nullable public static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext clientSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating client SSL context from configuration"); String trustStoreFilePath = sslConfig.getString(Se...
SSLUtils { @Nullable public static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext clientSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating client SSL context from configuration"); String trustStoreFilePath = sslConfig.g...
SSLUtils { @Nullable public static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext clientSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating client SSL context from configuration"); String trustStoreFilePath = sslConfig.g...
SSLUtils { @Nullable public static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext clientSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating client SSL context from configuration"); String trustStoreFilePath = sslConfig.g...
SSLUtils { @Nullable public static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext clientSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating client SSL context from configuration"); String trustStoreFilePath = sslConfig.g...
@Test public void testCreateSSLClientContextWithSSLDisabled() throws Exception { Configuration clientConfig = new Configuration(); clientConfig.setBoolean(SecurityOptions.SSL_ENABLED, false); SSLContext clientContext = SSLUtils.createSSLClientContext(clientConfig); Assert.assertNull(clientContext); }
@Nullable public static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext clientSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating client SSL context from configuration"); String trustStoreFilePath = sslConfig.getString(Se...
SSLUtils { @Nullable public static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext clientSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating client SSL context from configuration"); String trustStoreFilePath = sslConfig.g...
SSLUtils { @Nullable public static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext clientSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating client SSL context from configuration"); String trustStoreFilePath = sslConfig.g...
SSLUtils { @Nullable public static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext clientSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating client SSL context from configuration"); String trustStoreFilePath = sslConfig.g...
SSLUtils { @Nullable public static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext clientSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating client SSL context from configuration"); String trustStoreFilePath = sslConfig.g...
@Test public void testCreateSSLClientContextMisconfiguration() { Configuration clientConfig = new Configuration(); clientConfig.setBoolean(SecurityOptions.SSL_ENABLED, true); clientConfig.setString(SecurityOptions.SSL_TRUSTSTORE, "src/test/resources/local127.truststore"); clientConfig.setString(SecurityOptions.SSL_TRUS...
@Nullable public static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext clientSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating client SSL context from configuration"); String trustStoreFilePath = sslConfig.getString(Se...
SSLUtils { @Nullable public static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext clientSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating client SSL context from configuration"); String trustStoreFilePath = sslConfig.g...
SSLUtils { @Nullable public static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext clientSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating client SSL context from configuration"); String trustStoreFilePath = sslConfig.g...
SSLUtils { @Nullable public static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext clientSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating client SSL context from configuration"); String trustStoreFilePath = sslConfig.g...
SSLUtils { @Nullable public static SSLContext createSSLClientContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext clientSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating client SSL context from configuration"); String trustStoreFilePath = sslConfig.g...
@Test public void testCreateSSLServerContext() throws Exception { Configuration serverConfig = new Configuration(); serverConfig.setBoolean(SecurityOptions.SSL_ENABLED, true); serverConfig.setString(SecurityOptions.SSL_KEYSTORE, "src/test/resources/local127.keystore"); serverConfig.setString(SecurityOptions.SSL_KEYSTOR...
@Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.getString(Secu...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
@Test public void testCreateSSLServerContextWithSSLDisabled() throws Exception { Configuration serverConfig = new Configuration(); serverConfig.setBoolean(SecurityOptions.SSL_ENABLED, false); SSLContext serverContext = SSLUtils.createSSLServerContext(serverConfig); Assert.assertNull(serverContext); }
@Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.getString(Secu...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
@Test public void testCreateSSLServerContextMisconfiguration() { Configuration serverConfig = new Configuration(); serverConfig.setBoolean(SecurityOptions.SSL_ENABLED, true); serverConfig.setString(SecurityOptions.SSL_KEYSTORE, "src/test/resources/local127.keystore"); serverConfig.setString(SecurityOptions.SSL_KEYSTORE...
@Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.getString(Secu...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
@Test public void testCreateSSLServerContextWithMultiProtocols() { Configuration serverConfig = new Configuration(); serverConfig.setBoolean(SecurityOptions.SSL_ENABLED, true); serverConfig.setString(SecurityOptions.SSL_KEYSTORE, "src/test/resources/local127.keystore"); serverConfig.setString(SecurityOptions.SSL_KEYSTO...
@Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.getString(Secu...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
SSLUtils { @Nullable public static SSLContext createSSLServerContext(Configuration sslConfig) throws Exception { Preconditions.checkNotNull(sslConfig); SSLContext serverSSLContext = null; if (getSSLEnabled(sslConfig)) { LOG.debug("Creating server SSL context from configuration"); String keystoreFilePath = sslConfig.get...
@Test public void testCreateSSLEngineFactory() throws Exception { Configuration serverConfig = new Configuration(); serverConfig.setBoolean(SecurityOptions.SSL_ENABLED, true); serverConfig.setString(SecurityOptions.SSL_KEYSTORE, "src/test/resources/local127.keystore"); serverConfig.setString(SecurityOptions.SSL_KEYSTOR...
private static SSLEngineFactory createSSLEngineFactory( final Configuration config, final boolean clientMode) throws Exception { final SSLContext sslContext = clientMode ? createSSLClientContext(config) : createSSLServerContext(config); checkState(sslContext != null, "%s it not enabled", SecurityOptions.SSL_ENABLED.key...
SSLUtils { private static SSLEngineFactory createSSLEngineFactory( final Configuration config, final boolean clientMode) throws Exception { final SSLContext sslContext = clientMode ? createSSLClientContext(config) : createSSLServerContext(config); checkState(sslContext != null, "%s it not enabled", SecurityOptions.SSL_...
SSLUtils { private static SSLEngineFactory createSSLEngineFactory( final Configuration config, final boolean clientMode) throws Exception { final SSLContext sslContext = clientMode ? createSSLClientContext(config) : createSSLServerContext(config); checkState(sslContext != null, "%s it not enabled", SecurityOptions.SSL_...
SSLUtils { private static SSLEngineFactory createSSLEngineFactory( final Configuration config, final boolean clientMode) throws Exception { final SSLContext sslContext = clientMode ? createSSLClientContext(config) : createSSLServerContext(config); checkState(sslContext != null, "%s it not enabled", SecurityOptions.SSL_...
SSLUtils { private static SSLEngineFactory createSSLEngineFactory( final Configuration config, final boolean clientMode) throws Exception { final SSLContext sslContext = clientMode ? createSSLClientContext(config) : createSSLServerContext(config); checkState(sslContext != null, "%s it not enabled", SecurityOptions.SSL_...
@Test public void testRetryWithDelay() throws Exception { final int retries = 4; final Time delay = Time.milliseconds(5L); final AtomicInteger countDown = new AtomicInteger(retries); long start = System.currentTimeMillis(); CompletableFuture<Boolean> retryFuture = FutureUtils.retryWithDelay( () -> { if (countDown.getAn...
public static <T> CompletableFuture<T> retryWithDelay( final Supplier<CompletableFuture<T>> operation, final int retries, final Time retryDelay, final Predicate<Throwable> retryPredicate, final ScheduledExecutor scheduledExecutor) { final CompletableFuture<T> resultFuture = new CompletableFuture<>(); retryOperationWith...
FutureUtils { public static <T> CompletableFuture<T> retryWithDelay( final Supplier<CompletableFuture<T>> operation, final int retries, final Time retryDelay, final Predicate<Throwable> retryPredicate, final ScheduledExecutor scheduledExecutor) { final CompletableFuture<T> resultFuture = new CompletableFuture<>(); retr...
FutureUtils { public static <T> CompletableFuture<T> retryWithDelay( final Supplier<CompletableFuture<T>> operation, final int retries, final Time retryDelay, final Predicate<Throwable> retryPredicate, final ScheduledExecutor scheduledExecutor) { final CompletableFuture<T> resultFuture = new CompletableFuture<>(); retr...
FutureUtils { public static <T> CompletableFuture<T> retryWithDelay( final Supplier<CompletableFuture<T>> operation, final int retries, final Time retryDelay, final Predicate<Throwable> retryPredicate, final ScheduledExecutor scheduledExecutor) { final CompletableFuture<T> resultFuture = new CompletableFuture<>(); retr...
FutureUtils { public static <T> CompletableFuture<T> retryWithDelay( final Supplier<CompletableFuture<T>> operation, final int retries, final Time retryDelay, final Predicate<Throwable> retryPredicate, final ScheduledExecutor scheduledExecutor) { final CompletableFuture<T> resultFuture = new CompletableFuture<>(); retr...
@Test public void testOrTimeout() throws Exception { final CompletableFuture<String> future = new CompletableFuture<>(); final long timeout = 10L; FutureUtils.orTimeout(future, timeout, TimeUnit.MILLISECONDS); try { future.get(); } catch (ExecutionException e) { assertTrue(ExceptionUtils.stripExecutionException(e) inst...
public static <T> CompletableFuture<T> orTimeout(CompletableFuture<T> future, long timeout, TimeUnit timeUnit) { if (!future.isDone()) { final ScheduledFuture<?> timeoutFuture = Delayer.delay(new Timeout(future), timeout, timeUnit); future.whenComplete((T value, Throwable throwable) -> { if (!timeoutFuture.isDone()) { ...
FutureUtils { public static <T> CompletableFuture<T> orTimeout(CompletableFuture<T> future, long timeout, TimeUnit timeUnit) { if (!future.isDone()) { final ScheduledFuture<?> timeoutFuture = Delayer.delay(new Timeout(future), timeout, timeUnit); future.whenComplete((T value, Throwable throwable) -> { if (!timeoutFutur...
FutureUtils { public static <T> CompletableFuture<T> orTimeout(CompletableFuture<T> future, long timeout, TimeUnit timeUnit) { if (!future.isDone()) { final ScheduledFuture<?> timeoutFuture = Delayer.delay(new Timeout(future), timeout, timeUnit); future.whenComplete((T value, Throwable throwable) -> { if (!timeoutFutur...
FutureUtils { public static <T> CompletableFuture<T> orTimeout(CompletableFuture<T> future, long timeout, TimeUnit timeUnit) { if (!future.isDone()) { final ScheduledFuture<?> timeoutFuture = Delayer.delay(new Timeout(future), timeout, timeUnit); future.whenComplete((T value, Throwable throwable) -> { if (!timeoutFutur...
FutureUtils { public static <T> CompletableFuture<T> orTimeout(CompletableFuture<T> future, long timeout, TimeUnit timeUnit) { if (!future.isDone()) { final ScheduledFuture<?> timeoutFuture = Delayer.delay(new Timeout(future), timeout, timeUnit); future.whenComplete((T value, Throwable throwable) -> { if (!timeoutFutur...
@Test public void testRunAfterwards() throws Exception { final CompletableFuture<Void> inputFuture = new CompletableFuture<>(); final OneShotLatch runnableLatch = new OneShotLatch(); final CompletableFuture<Void> runFuture = FutureUtils.runAfterwards( inputFuture, runnableLatch::trigger); assertThat(runnableLatch.isTri...
public static CompletableFuture<Void> runAfterwards(CompletableFuture<?> future, RunnableWithException runnable) { return runAfterwardsAsync(future, runnable, Executors.directExecutor()); }
FutureUtils { public static CompletableFuture<Void> runAfterwards(CompletableFuture<?> future, RunnableWithException runnable) { return runAfterwardsAsync(future, runnable, Executors.directExecutor()); } }
FutureUtils { public static CompletableFuture<Void> runAfterwards(CompletableFuture<?> future, RunnableWithException runnable) { return runAfterwardsAsync(future, runnable, Executors.directExecutor()); } }
FutureUtils { public static CompletableFuture<Void> runAfterwards(CompletableFuture<?> future, RunnableWithException runnable) { return runAfterwardsAsync(future, runnable, Executors.directExecutor()); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int retries, fina...
FutureUtils { public static CompletableFuture<Void> runAfterwards(CompletableFuture<?> future, RunnableWithException runnable) { return runAfterwardsAsync(future, runnable, Executors.directExecutor()); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int retries, fina...
@Test public void testRunAfterwardsExceptional() throws Exception { final CompletableFuture<Void> inputFuture = new CompletableFuture<>(); final OneShotLatch runnableLatch = new OneShotLatch(); final FlinkException testException = new FlinkException("Test exception"); final CompletableFuture<Void> runFuture = FutureUti...
public static CompletableFuture<Void> runAfterwards(CompletableFuture<?> future, RunnableWithException runnable) { return runAfterwardsAsync(future, runnable, Executors.directExecutor()); }
FutureUtils { public static CompletableFuture<Void> runAfterwards(CompletableFuture<?> future, RunnableWithException runnable) { return runAfterwardsAsync(future, runnable, Executors.directExecutor()); } }
FutureUtils { public static CompletableFuture<Void> runAfterwards(CompletableFuture<?> future, RunnableWithException runnable) { return runAfterwardsAsync(future, runnable, Executors.directExecutor()); } }
FutureUtils { public static CompletableFuture<Void> runAfterwards(CompletableFuture<?> future, RunnableWithException runnable) { return runAfterwardsAsync(future, runnable, Executors.directExecutor()); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int retries, fina...
FutureUtils { public static CompletableFuture<Void> runAfterwards(CompletableFuture<?> future, RunnableWithException runnable) { return runAfterwardsAsync(future, runnable, Executors.directExecutor()); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int retries, fina...
@Test public void testComposeAfterwards() throws ExecutionException, InterruptedException { final CompletableFuture<Void> inputFuture = new CompletableFuture<>(); final OneShotLatch composeLatch = new OneShotLatch(); final CompletableFuture<Void> composeFuture = FutureUtils.composeAfterwards( inputFuture, () -> { compo...
public static CompletableFuture<Void> composeAfterwards( CompletableFuture<?> future, Supplier<CompletableFuture<?>> composedAction) { final CompletableFuture<Void> resultFuture = new CompletableFuture<>(); future.whenComplete( (Object outerIgnored, Throwable outerThrowable) -> { final CompletableFuture<?> composedActi...
FutureUtils { public static CompletableFuture<Void> composeAfterwards( CompletableFuture<?> future, Supplier<CompletableFuture<?>> composedAction) { final CompletableFuture<Void> resultFuture = new CompletableFuture<>(); future.whenComplete( (Object outerIgnored, Throwable outerThrowable) -> { final CompletableFuture<?...
FutureUtils { public static CompletableFuture<Void> composeAfterwards( CompletableFuture<?> future, Supplier<CompletableFuture<?>> composedAction) { final CompletableFuture<Void> resultFuture = new CompletableFuture<>(); future.whenComplete( (Object outerIgnored, Throwable outerThrowable) -> { final CompletableFuture<?...
FutureUtils { public static CompletableFuture<Void> composeAfterwards( CompletableFuture<?> future, Supplier<CompletableFuture<?>> composedAction) { final CompletableFuture<Void> resultFuture = new CompletableFuture<>(); future.whenComplete( (Object outerIgnored, Throwable outerThrowable) -> { final CompletableFuture<?...
FutureUtils { public static CompletableFuture<Void> composeAfterwards( CompletableFuture<?> future, Supplier<CompletableFuture<?>> composedAction) { final CompletableFuture<Void> resultFuture = new CompletableFuture<>(); future.whenComplete( (Object outerIgnored, Throwable outerThrowable) -> { final CompletableFuture<?...
@Test public void testComposeAfterwardsFirstExceptional() throws InterruptedException { final CompletableFuture<Void> inputFuture = new CompletableFuture<>(); final OneShotLatch composeLatch = new OneShotLatch(); final FlinkException testException = new FlinkException("Test exception"); final CompletableFuture<Void> co...
public static CompletableFuture<Void> composeAfterwards( CompletableFuture<?> future, Supplier<CompletableFuture<?>> composedAction) { final CompletableFuture<Void> resultFuture = new CompletableFuture<>(); future.whenComplete( (Object outerIgnored, Throwable outerThrowable) -> { final CompletableFuture<?> composedActi...
FutureUtils { public static CompletableFuture<Void> composeAfterwards( CompletableFuture<?> future, Supplier<CompletableFuture<?>> composedAction) { final CompletableFuture<Void> resultFuture = new CompletableFuture<>(); future.whenComplete( (Object outerIgnored, Throwable outerThrowable) -> { final CompletableFuture<?...
FutureUtils { public static CompletableFuture<Void> composeAfterwards( CompletableFuture<?> future, Supplier<CompletableFuture<?>> composedAction) { final CompletableFuture<Void> resultFuture = new CompletableFuture<>(); future.whenComplete( (Object outerIgnored, Throwable outerThrowable) -> { final CompletableFuture<?...
FutureUtils { public static CompletableFuture<Void> composeAfterwards( CompletableFuture<?> future, Supplier<CompletableFuture<?>> composedAction) { final CompletableFuture<Void> resultFuture = new CompletableFuture<>(); future.whenComplete( (Object outerIgnored, Throwable outerThrowable) -> { final CompletableFuture<?...
FutureUtils { public static CompletableFuture<Void> composeAfterwards( CompletableFuture<?> future, Supplier<CompletableFuture<?>> composedAction) { final CompletableFuture<Void> resultFuture = new CompletableFuture<>(); future.whenComplete( (Object outerIgnored, Throwable outerThrowable) -> { final CompletableFuture<?...
@Test public void testCompleteAll() throws Exception { final CompletableFuture<String> inputFuture1 = new CompletableFuture<>(); final CompletableFuture<Integer> inputFuture2 = new CompletableFuture<>(); final List<CompletableFuture<?>> futuresToComplete = Arrays.asList(inputFuture1, inputFuture2); final FutureUtils.Co...
public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); }
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } }
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } }
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int retries, final Executor executor);...
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int retries, final Executor executor);...
@Test public void testCompleteAllPartialExceptional() throws Exception { final CompletableFuture<String> inputFuture1 = new CompletableFuture<>(); final CompletableFuture<Integer> inputFuture2 = new CompletableFuture<>(); final List<CompletableFuture<?>> futuresToComplete = Arrays.asList(inputFuture1, inputFuture2); fi...
public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); }
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } }
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } }
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int retries, final Executor executor);...
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int retries, final Executor executor);...
@Test public void testCompleteAllExceptional() throws Exception { final CompletableFuture<String> inputFuture1 = new CompletableFuture<>(); final CompletableFuture<Integer> inputFuture2 = new CompletableFuture<>(); final List<CompletableFuture<?>> futuresToComplete = Arrays.asList(inputFuture1, inputFuture2); final Fut...
public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); }
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } }
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } }
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int retries, final Executor executor);...
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int retries, final Executor executor);...
@Test public void testCancelWaitingConjunctFuture() { cancelConjunctFuture(inputFutures -> FutureUtils.waitForAll(inputFutures)); }
public static ConjunctFuture<Void> waitForAll(Collection<? extends CompletableFuture<?>> futures) { checkNotNull(futures, "futures"); return new WaitingConjunctFuture(futures); }
FutureUtils { public static ConjunctFuture<Void> waitForAll(Collection<? extends CompletableFuture<?>> futures) { checkNotNull(futures, "futures"); return new WaitingConjunctFuture(futures); } }
FutureUtils { public static ConjunctFuture<Void> waitForAll(Collection<? extends CompletableFuture<?>> futures) { checkNotNull(futures, "futures"); return new WaitingConjunctFuture(futures); } }
FutureUtils { public static ConjunctFuture<Void> waitForAll(Collection<? extends CompletableFuture<?>> futures) { checkNotNull(futures, "futures"); return new WaitingConjunctFuture(futures); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int retries, final Executor ...
FutureUtils { public static ConjunctFuture<Void> waitForAll(Collection<? extends CompletableFuture<?>> futures) { checkNotNull(futures, "futures"); return new WaitingConjunctFuture(futures); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int retries, final Executor ...
@Test public void testCancelResultConjunctFuture() { cancelConjunctFuture(inputFutures -> FutureUtils.combineAll(inputFutures)); }
public static <T> ConjunctFuture<Collection<T>> combineAll(Collection<? extends CompletableFuture<? extends T>> futures) { checkNotNull(futures, "futures"); return new ResultConjunctFuture<>(futures); }
FutureUtils { public static <T> ConjunctFuture<Collection<T>> combineAll(Collection<? extends CompletableFuture<? extends T>> futures) { checkNotNull(futures, "futures"); return new ResultConjunctFuture<>(futures); } }
FutureUtils { public static <T> ConjunctFuture<Collection<T>> combineAll(Collection<? extends CompletableFuture<? extends T>> futures) { checkNotNull(futures, "futures"); return new ResultConjunctFuture<>(futures); } }
FutureUtils { public static <T> ConjunctFuture<Collection<T>> combineAll(Collection<? extends CompletableFuture<? extends T>> futures) { checkNotNull(futures, "futures"); return new ResultConjunctFuture<>(futures); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int ret...
FutureUtils { public static <T> ConjunctFuture<Collection<T>> combineAll(Collection<? extends CompletableFuture<? extends T>> futures) { checkNotNull(futures, "futures"); return new ResultConjunctFuture<>(futures); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int ret...
@Test public void testCancelCompleteConjunctFuture() { cancelConjunctFuture(inputFutures -> FutureUtils.completeAll(inputFutures)); }
public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); }
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } }
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } }
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int retries, final Executor executor);...
FutureUtils { public static ConjunctFuture<Void> completeAll(Collection<? extends CompletableFuture<?>> futuresToComplete) { return new CompletionConjunctFuture(futuresToComplete); } static CompletableFuture<T> retry( final Supplier<CompletableFuture<T>> operation, final int retries, final Executor executor);...
@Test public void testSupplyAsyncFailure() throws Exception { final String exceptionMessage = "Test exception"; final FlinkException testException = new FlinkException(exceptionMessage); final CompletableFuture<Object> future = FutureUtils.supplyAsync( () -> { throw testException; }, TestingUtils.defaultExecutor()); tr...
public static <T> CompletableFuture<T> supplyAsync(SupplierWithException<T, ?> supplier, Executor executor) { return CompletableFuture.supplyAsync( () -> { try { return supplier.get(); } catch (Throwable e) { throw new CompletionException(e); } }, executor); }
FutureUtils { public static <T> CompletableFuture<T> supplyAsync(SupplierWithException<T, ?> supplier, Executor executor) { return CompletableFuture.supplyAsync( () -> { try { return supplier.get(); } catch (Throwable e) { throw new CompletionException(e); } }, executor); } }
FutureUtils { public static <T> CompletableFuture<T> supplyAsync(SupplierWithException<T, ?> supplier, Executor executor) { return CompletableFuture.supplyAsync( () -> { try { return supplier.get(); } catch (Throwable e) { throw new CompletionException(e); } }, executor); } }
FutureUtils { public static <T> CompletableFuture<T> supplyAsync(SupplierWithException<T, ?> supplier, Executor executor) { return CompletableFuture.supplyAsync( () -> { try { return supplier.get(); } catch (Throwable e) { throw new CompletionException(e); } }, executor); } static CompletableFuture<T> retry( final ...
FutureUtils { public static <T> CompletableFuture<T> supplyAsync(SupplierWithException<T, ?> supplier, Executor executor) { return CompletableFuture.supplyAsync( () -> { try { return supplier.get(); } catch (Throwable e) { throw new CompletionException(e); } }, executor); } static CompletableFuture<T> retry( final ...
@Test public void testSupplyAsync() throws Exception { final CompletableFuture<Acknowledge> future = FutureUtils.supplyAsync( Acknowledge::get, TestingUtils.defaultExecutor()); assertThat(future.get(), is(Acknowledge.get())); }
public static <T> CompletableFuture<T> supplyAsync(SupplierWithException<T, ?> supplier, Executor executor) { return CompletableFuture.supplyAsync( () -> { try { return supplier.get(); } catch (Throwable e) { throw new CompletionException(e); } }, executor); }
FutureUtils { public static <T> CompletableFuture<T> supplyAsync(SupplierWithException<T, ?> supplier, Executor executor) { return CompletableFuture.supplyAsync( () -> { try { return supplier.get(); } catch (Throwable e) { throw new CompletionException(e); } }, executor); } }
FutureUtils { public static <T> CompletableFuture<T> supplyAsync(SupplierWithException<T, ?> supplier, Executor executor) { return CompletableFuture.supplyAsync( () -> { try { return supplier.get(); } catch (Throwable e) { throw new CompletionException(e); } }, executor); } }
FutureUtils { public static <T> CompletableFuture<T> supplyAsync(SupplierWithException<T, ?> supplier, Executor executor) { return CompletableFuture.supplyAsync( () -> { try { return supplier.get(); } catch (Throwable e) { throw new CompletionException(e); } }, executor); } static CompletableFuture<T> retry( final ...
FutureUtils { public static <T> CompletableFuture<T> supplyAsync(SupplierWithException<T, ?> supplier, Executor executor) { return CompletableFuture.supplyAsync( () -> { try { return supplier.get(); } catch (Throwable e) { throw new CompletionException(e); } }, executor); } static CompletableFuture<T> retry( final ...
@Test public void testTerminationAfterJobCompletion() throws Exception { final MiniDispatcher miniDispatcher = createMiniDispatcher(ClusterEntrypoint.ExecutionMode.DETACHED); miniDispatcher.start(); try { dispatcherLeaderElectionService.isLeader(UUID.randomUUID()).get(); jobGraphFuture.get(); resultFuture.complete(arch...
public CompletableFuture<ApplicationStatus> getJobTerminationFuture() { return jobTerminationFuture; }
MiniDispatcher extends Dispatcher { public CompletableFuture<ApplicationStatus> getJobTerminationFuture() { return jobTerminationFuture; } }
MiniDispatcher extends Dispatcher { public CompletableFuture<ApplicationStatus> getJobTerminationFuture() { return jobTerminationFuture; } MiniDispatcher( RpcService rpcService, String endpointId, Configuration configuration, HighAvailabilityServices highAvailabilityServices, ResourceManagerGateway resou...
MiniDispatcher extends Dispatcher { public CompletableFuture<ApplicationStatus> getJobTerminationFuture() { return jobTerminationFuture; } MiniDispatcher( RpcService rpcService, String endpointId, Configuration configuration, HighAvailabilityServices highAvailabilityServices, ResourceManagerGateway resou...
MiniDispatcher extends Dispatcher { public CompletableFuture<ApplicationStatus> getJobTerminationFuture() { return jobTerminationFuture; } MiniDispatcher( RpcService rpcService, String endpointId, Configuration configuration, HighAvailabilityServices highAvailabilityServices, ResourceManagerGateway resou...
@Test public void testJobResultRetrieval() throws Exception { final MiniDispatcher miniDispatcher = createMiniDispatcher(ClusterEntrypoint.ExecutionMode.NORMAL); miniDispatcher.start(); try { dispatcherLeaderElectionService.isLeader(UUID.randomUUID()).get(); jobGraphFuture.get(); resultFuture.complete(archivedExecution...
@Override public CompletableFuture<JobResult> requestJobResult(JobID jobId, Time timeout) { final CompletableFuture<JobResult> jobResultFuture = super.requestJobResult(jobId, timeout); if (executionMode == ClusterEntrypoint.ExecutionMode.NORMAL) { jobResultFuture.thenAccept((JobResult result) -> { ApplicationStatus sta...
MiniDispatcher extends Dispatcher { @Override public CompletableFuture<JobResult> requestJobResult(JobID jobId, Time timeout) { final CompletableFuture<JobResult> jobResultFuture = super.requestJobResult(jobId, timeout); if (executionMode == ClusterEntrypoint.ExecutionMode.NORMAL) { jobResultFuture.thenAccept((JobResul...
MiniDispatcher extends Dispatcher { @Override public CompletableFuture<JobResult> requestJobResult(JobID jobId, Time timeout) { final CompletableFuture<JobResult> jobResultFuture = super.requestJobResult(jobId, timeout); if (executionMode == ClusterEntrypoint.ExecutionMode.NORMAL) { jobResultFuture.thenAccept((JobResul...
MiniDispatcher extends Dispatcher { @Override public CompletableFuture<JobResult> requestJobResult(JobID jobId, Time timeout) { final CompletableFuture<JobResult> jobResultFuture = super.requestJobResult(jobId, timeout); if (executionMode == ClusterEntrypoint.ExecutionMode.NORMAL) { jobResultFuture.thenAccept((JobResul...
MiniDispatcher extends Dispatcher { @Override public CompletableFuture<JobResult> requestJobResult(JobID jobId, Time timeout) { final CompletableFuture<JobResult> jobResultFuture = super.requestJobResult(jobId, timeout); if (executionMode == ClusterEntrypoint.ExecutionMode.NORMAL) { jobResultFuture.thenAccept((JobResul...
@Test public void testJobSubmission() throws Exception { CompletableFuture<UUID> leaderFuture = dispatcherLeaderElectionService.isLeader(UUID.randomUUID()); leaderFuture.get(); DispatcherGateway dispatcherGateway = dispatcher.getSelfGateway(DispatcherGateway.class); CompletableFuture<Acknowledge> acknowledgeFuture = di...
@Override public CompletableFuture<Acknowledge> submitJob(JobGraph jobGraph, Time timeout) { final JobID jobId = jobGraph.getJobID(); log.info("Submitting job {} ({}).", jobId, jobGraph.getName()); try { final RunningJobsRegistry.JobSchedulingStatus jobSchedulingStatus = runningJobsRegistry.getJobSchedulingStatus(jobId...
Dispatcher extends FencedRpcEndpoint<DispatcherId> implements DispatcherGateway, LeaderContender, SubmittedJobGraphStore.SubmittedJobGraphListener { @Override public CompletableFuture<Acknowledge> submitJob(JobGraph jobGraph, Time timeout) { final JobID jobId = jobGraph.getJobID(); log.info("Submitting job {} ({}).", ...
Dispatcher extends FencedRpcEndpoint<DispatcherId> implements DispatcherGateway, LeaderContender, SubmittedJobGraphStore.SubmittedJobGraphListener { @Override public CompletableFuture<Acknowledge> submitJob(JobGraph jobGraph, Time timeout) { final JobID jobId = jobGraph.getJobID(); log.info("Submitting job {} ({}).", ...
Dispatcher extends FencedRpcEndpoint<DispatcherId> implements DispatcherGateway, LeaderContender, SubmittedJobGraphStore.SubmittedJobGraphListener { @Override public CompletableFuture<Acknowledge> submitJob(JobGraph jobGraph, Time timeout) { final JobID jobId = jobGraph.getJobID(); log.info("Submitting job {} ({}).", ...
Dispatcher extends FencedRpcEndpoint<DispatcherId> implements DispatcherGateway, LeaderContender, SubmittedJobGraphStore.SubmittedJobGraphListener { @Override public CompletableFuture<Acknowledge> submitJob(JobGraph jobGraph, Time timeout) { final JobID jobId = jobGraph.getJobID(); log.info("Submitting job {} ({}).", ...
@Test public void testThrowExceptionIfJobExecutionResultNotFound() throws Exception { dispatcherLeaderElectionService.isLeader(UUID.randomUUID()).get(); final DispatcherGateway dispatcherGateway = dispatcher.getSelfGateway(DispatcherGateway.class); try { dispatcherGateway.requestJob(new JobID(), TIMEOUT).get(); } catch...
@Override public CompletableFuture<ArchivedExecutionGraph> requestJob(JobID jobId, Time timeout) { final CompletableFuture<JobMasterGateway> jobMasterGatewayFuture = getJobMasterGatewayFuture(jobId); final CompletableFuture<ArchivedExecutionGraph> archivedExecutionGraphFuture = jobMasterGatewayFuture.thenCompose( (JobM...
Dispatcher extends FencedRpcEndpoint<DispatcherId> implements DispatcherGateway, LeaderContender, SubmittedJobGraphStore.SubmittedJobGraphListener { @Override public CompletableFuture<ArchivedExecutionGraph> requestJob(JobID jobId, Time timeout) { final CompletableFuture<JobMasterGateway> jobMasterGatewayFuture = getJ...
Dispatcher extends FencedRpcEndpoint<DispatcherId> implements DispatcherGateway, LeaderContender, SubmittedJobGraphStore.SubmittedJobGraphListener { @Override public CompletableFuture<ArchivedExecutionGraph> requestJob(JobID jobId, Time timeout) { final CompletableFuture<JobMasterGateway> jobMasterGatewayFuture = getJ...
Dispatcher extends FencedRpcEndpoint<DispatcherId> implements DispatcherGateway, LeaderContender, SubmittedJobGraphStore.SubmittedJobGraphListener { @Override public CompletableFuture<ArchivedExecutionGraph> requestJob(JobID jobId, Time timeout) { final CompletableFuture<JobMasterGateway> jobMasterGatewayFuture = getJ...
Dispatcher extends FencedRpcEndpoint<DispatcherId> implements DispatcherGateway, LeaderContender, SubmittedJobGraphStore.SubmittedJobGraphListener { @Override public CompletableFuture<ArchivedExecutionGraph> requestJob(JobID jobId, Time timeout) { final CompletableFuture<JobMasterGateway> jobMasterGatewayFuture = getJ...
@Test public void testSavepointDisposal() throws Exception { final URI externalPointer = createTestingSavepoint(); final Path savepointPath = Paths.get(externalPointer); final DispatcherGateway dispatcherGateway = dispatcher.getSelfGateway(DispatcherGateway.class); dispatcherLeaderElectionService.isLeader(UUID.randomUU...
@Override public CompletableFuture<Acknowledge> disposeSavepoint(String savepointPath, Time timeout) { final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); return CompletableFuture.supplyAsync( () -> { log.info("Disposing savepoint {}.", savepointPath); try { Checkpoints.disposeSavepoint(save...
Dispatcher extends FencedRpcEndpoint<DispatcherId> implements DispatcherGateway, LeaderContender, SubmittedJobGraphStore.SubmittedJobGraphListener { @Override public CompletableFuture<Acknowledge> disposeSavepoint(String savepointPath, Time timeout) { final ClassLoader classLoader = Thread.currentThread().getContextCl...
Dispatcher extends FencedRpcEndpoint<DispatcherId> implements DispatcherGateway, LeaderContender, SubmittedJobGraphStore.SubmittedJobGraphListener { @Override public CompletableFuture<Acknowledge> disposeSavepoint(String savepointPath, Time timeout) { final ClassLoader classLoader = Thread.currentThread().getContextCl...
Dispatcher extends FencedRpcEndpoint<DispatcherId> implements DispatcherGateway, LeaderContender, SubmittedJobGraphStore.SubmittedJobGraphListener { @Override public CompletableFuture<Acknowledge> disposeSavepoint(String savepointPath, Time timeout) { final ClassLoader classLoader = Thread.currentThread().getContextCl...
Dispatcher extends FencedRpcEndpoint<DispatcherId> implements DispatcherGateway, LeaderContender, SubmittedJobGraphStore.SubmittedJobGraphListener { @Override public CompletableFuture<Acknowledge> disposeSavepoint(String savepointPath, Time timeout) { final ClassLoader classLoader = Thread.currentThread().getContextCl...
@Test public void testPut() throws IOException { final ArchivedExecutionGraph dummyExecutionGraph = new ArchivedExecutionGraphBuilder().setState(JobStatus.FINISHED).build(); final File rootDir = temporaryFolder.newFolder(); try (final FileArchivedExecutionGraphStore executionGraphStore = createDefaultExecutionGraphStor...
@Override public void put(ArchivedExecutionGraph archivedExecutionGraph) throws IOException { final JobStatus jobStatus = archivedExecutionGraph.getState(); final JobID jobId = archivedExecutionGraph.getJobID(); final String jobName = archivedExecutionGraph.getJobName(); Preconditions.checkArgument( jobStatus.isGloball...
FileArchivedExecutionGraphStore implements ArchivedExecutionGraphStore { @Override public void put(ArchivedExecutionGraph archivedExecutionGraph) throws IOException { final JobStatus jobStatus = archivedExecutionGraph.getState(); final JobID jobId = archivedExecutionGraph.getJobID(); final String jobName = archivedExec...
FileArchivedExecutionGraphStore implements ArchivedExecutionGraphStore { @Override public void put(ArchivedExecutionGraph archivedExecutionGraph) throws IOException { final JobStatus jobStatus = archivedExecutionGraph.getState(); final JobID jobId = archivedExecutionGraph.getJobID(); final String jobName = archivedExec...
FileArchivedExecutionGraphStore implements ArchivedExecutionGraphStore { @Override public void put(ArchivedExecutionGraph archivedExecutionGraph) throws IOException { final JobStatus jobStatus = archivedExecutionGraph.getState(); final JobID jobId = archivedExecutionGraph.getJobID(); final String jobName = archivedExec...
FileArchivedExecutionGraphStore implements ArchivedExecutionGraphStore { @Override public void put(ArchivedExecutionGraph archivedExecutionGraph) throws IOException { final JobStatus jobStatus = archivedExecutionGraph.getState(); final JobID jobId = archivedExecutionGraph.getJobID(); final String jobName = archivedExec...
@Test public void testUnknownGet() throws IOException { final File rootDir = temporaryFolder.newFolder(); try (final FileArchivedExecutionGraphStore executionGraphStore = createDefaultExecutionGraphStore(rootDir)) { assertThat(executionGraphStore.get(new JobID()), Matchers.nullValue()); } }
@Override @Nullable public ArchivedExecutionGraph get(JobID jobId) { try { return archivedExecutionGraphCache.get(jobId); } catch (ExecutionException e) { LOG.debug("Could not load archived execution graph for job id {}.", jobId, e); return null; } }
FileArchivedExecutionGraphStore implements ArchivedExecutionGraphStore { @Override @Nullable public ArchivedExecutionGraph get(JobID jobId) { try { return archivedExecutionGraphCache.get(jobId); } catch (ExecutionException e) { LOG.debug("Could not load archived execution graph for job id {}.", jobId, e); return null; ...
FileArchivedExecutionGraphStore implements ArchivedExecutionGraphStore { @Override @Nullable public ArchivedExecutionGraph get(JobID jobId) { try { return archivedExecutionGraphCache.get(jobId); } catch (ExecutionException e) { LOG.debug("Could not load archived execution graph for job id {}.", jobId, e); return null; ...
FileArchivedExecutionGraphStore implements ArchivedExecutionGraphStore { @Override @Nullable public ArchivedExecutionGraph get(JobID jobId) { try { return archivedExecutionGraphCache.get(jobId); } catch (ExecutionException e) { LOG.debug("Could not load archived execution graph for job id {}.", jobId, e); return null; ...
FileArchivedExecutionGraphStore implements ArchivedExecutionGraphStore { @Override @Nullable public ArchivedExecutionGraph get(JobID jobId) { try { return archivedExecutionGraphCache.get(jobId); } catch (ExecutionException e) { LOG.debug("Could not load archived execution graph for job id {}.", jobId, e); return null; ...
@Test public void testOnPartitionStateUpdate() throws Exception { IntermediateDataSetID resultId = new IntermediateDataSetID(); ResultPartitionID partitionId = new ResultPartitionID(); SingleInputGate inputGate = mock(SingleInputGate.class); when(inputGate.getConsumedResultId()).thenReturn(resultId); final Task task = ...
@VisibleForTesting void onPartitionStateUpdate( IntermediateDataSetID intermediateDataSetId, ResultPartitionID resultPartitionId, ExecutionState producerState) throws IOException, InterruptedException { if (executionState == ExecutionState.RUNNING) { final SingleInputGate inputGate = inputGatesById.get(intermediateData...
Task implements Runnable, TaskActions, CheckpointListener { @VisibleForTesting void onPartitionStateUpdate( IntermediateDataSetID intermediateDataSetId, ResultPartitionID resultPartitionId, ExecutionState producerState) throws IOException, InterruptedException { if (executionState == ExecutionState.RUNNING) { final Sin...
Task implements Runnable, TaskActions, CheckpointListener { @VisibleForTesting void onPartitionStateUpdate( IntermediateDataSetID intermediateDataSetId, ResultPartitionID resultPartitionId, ExecutionState producerState) throws IOException, InterruptedException { if (executionState == ExecutionState.RUNNING) { final Sin...
Task implements Runnable, TaskActions, CheckpointListener { @VisibleForTesting void onPartitionStateUpdate( IntermediateDataSetID intermediateDataSetId, ResultPartitionID resultPartitionId, ExecutionState producerState) throws IOException, InterruptedException { if (executionState == ExecutionState.RUNNING) { final Sin...
Task implements Runnable, TaskActions, CheckpointListener { @VisibleForTesting void onPartitionStateUpdate( IntermediateDataSetID intermediateDataSetId, ResultPartitionID resultPartitionId, ExecutionState producerState) throws IOException, InterruptedException { if (executionState == ExecutionState.RUNNING) { final Sin...
@Test public void testRequestTaskManagerInfo() throws Exception { final Configuration configuration = new Configuration(); final ResourceManagerConfiguration resourceManagerConfiguration = ResourceManagerConfiguration.fromConfiguration(configuration); final TestingHighAvailabilityServices highAvailabilityServices = new...
@Override public CompletableFuture<Collection<TaskManagerInfo>> requestTaskManagerInfo(Time timeout) { final ArrayList<TaskManagerInfo> taskManagerInfos = new ArrayList<>(taskExecutors.size()); for (Map.Entry<ResourceID, WorkerRegistration<WorkerType>> taskExecutorEntry : taskExecutors.entrySet()) { final ResourceID re...
ResourceManager extends FencedRpcEndpoint<ResourceManagerId> implements ResourceManagerGateway, LeaderContender { @Override public CompletableFuture<Collection<TaskManagerInfo>> requestTaskManagerInfo(Time timeout) { final ArrayList<TaskManagerInfo> taskManagerInfos = new ArrayList<>(taskExecutors.size()); for (Map.Ent...
ResourceManager extends FencedRpcEndpoint<ResourceManagerId> implements ResourceManagerGateway, LeaderContender { @Override public CompletableFuture<Collection<TaskManagerInfo>> requestTaskManagerInfo(Time timeout) { final ArrayList<TaskManagerInfo> taskManagerInfos = new ArrayList<>(taskExecutors.size()); for (Map.Ent...
ResourceManager extends FencedRpcEndpoint<ResourceManagerId> implements ResourceManagerGateway, LeaderContender { @Override public CompletableFuture<Collection<TaskManagerInfo>> requestTaskManagerInfo(Time timeout) { final ArrayList<TaskManagerInfo> taskManagerInfos = new ArrayList<>(taskExecutors.size()); for (Map.Ent...
ResourceManager extends FencedRpcEndpoint<ResourceManagerId> implements ResourceManagerGateway, LeaderContender { @Override public CompletableFuture<Collection<TaskManagerInfo>> requestTaskManagerInfo(Time timeout) { final ArrayList<TaskManagerInfo> taskManagerInfos = new ArrayList<>(taskExecutors.size()); for (Map.Ent...
@Test public void testSlotRequestWithoutFreeSlots() throws Exception { final ResourceManagerId resourceManagerId = ResourceManagerId.generate(); final ResourceProfile resourceProfile = new ResourceProfile(42.0, 1337); final SlotRequest slotRequest = new SlotRequest( new JobID(), new AllocationID(), resourceProfile, "lo...
public boolean registerSlotRequest(SlotRequest slotRequest) throws SlotManagerException { checkInit(); if (checkDuplicateRequest(slotRequest.getAllocationId())) { LOG.debug("Ignoring a duplicate slot request with allocation id {}.", slotRequest.getAllocationId()); return false; } else { PendingSlotRequest pendingSlotRe...
SlotManager implements AutoCloseable { public boolean registerSlotRequest(SlotRequest slotRequest) throws SlotManagerException { checkInit(); if (checkDuplicateRequest(slotRequest.getAllocationId())) { LOG.debug("Ignoring a duplicate slot request with allocation id {}.", slotRequest.getAllocationId()); return false; } ...
SlotManager implements AutoCloseable { public boolean registerSlotRequest(SlotRequest slotRequest) throws SlotManagerException { checkInit(); if (checkDuplicateRequest(slotRequest.getAllocationId())) { LOG.debug("Ignoring a duplicate slot request with allocation id {}.", slotRequest.getAllocationId()); return false; } ...
SlotManager implements AutoCloseable { public boolean registerSlotRequest(SlotRequest slotRequest) throws SlotManagerException { checkInit(); if (checkDuplicateRequest(slotRequest.getAllocationId())) { LOG.debug("Ignoring a duplicate slot request with allocation id {}.", slotRequest.getAllocationId()); return false; } ...
SlotManager implements AutoCloseable { public boolean registerSlotRequest(SlotRequest slotRequest) throws SlotManagerException { checkInit(); if (checkDuplicateRequest(slotRequest.getAllocationId())) { LOG.debug("Ignoring a duplicate slot request with allocation id {}.", slotRequest.getAllocationId()); return false; } ...
@Test public void testSlotRequestWithResourceAllocationFailure() throws Exception { final ResourceManagerId resourceManagerId = ResourceManagerId.generate(); final ResourceProfile resourceProfile = new ResourceProfile(42.0, 1337); final SlotRequest slotRequest = new SlotRequest( new JobID(), new AllocationID(), resourc...
public boolean registerSlotRequest(SlotRequest slotRequest) throws SlotManagerException { checkInit(); if (checkDuplicateRequest(slotRequest.getAllocationId())) { LOG.debug("Ignoring a duplicate slot request with allocation id {}.", slotRequest.getAllocationId()); return false; } else { PendingSlotRequest pendingSlotRe...
SlotManager implements AutoCloseable { public boolean registerSlotRequest(SlotRequest slotRequest) throws SlotManagerException { checkInit(); if (checkDuplicateRequest(slotRequest.getAllocationId())) { LOG.debug("Ignoring a duplicate slot request with allocation id {}.", slotRequest.getAllocationId()); return false; } ...
SlotManager implements AutoCloseable { public boolean registerSlotRequest(SlotRequest slotRequest) throws SlotManagerException { checkInit(); if (checkDuplicateRequest(slotRequest.getAllocationId())) { LOG.debug("Ignoring a duplicate slot request with allocation id {}.", slotRequest.getAllocationId()); return false; } ...
SlotManager implements AutoCloseable { public boolean registerSlotRequest(SlotRequest slotRequest) throws SlotManagerException { checkInit(); if (checkDuplicateRequest(slotRequest.getAllocationId())) { LOG.debug("Ignoring a duplicate slot request with allocation id {}.", slotRequest.getAllocationId()); return false; } ...
SlotManager implements AutoCloseable { public boolean registerSlotRequest(SlotRequest slotRequest) throws SlotManagerException { checkInit(); if (checkDuplicateRequest(slotRequest.getAllocationId())) { LOG.debug("Ignoring a duplicate slot request with allocation id {}.", slotRequest.getAllocationId()); return false; } ...
@Test public void testFreeSlot() throws Exception { final ResourceManagerId resourceManagerId = ResourceManagerId.generate(); final ResourceID resourceID = ResourceID.generate(); final JobID jobId = new JobID(); final SlotID slotId = new SlotID(resourceID, 0); final AllocationID allocationId = new AllocationID(); final...
public void freeSlot(SlotID slotId, AllocationID allocationId) { checkInit(); TaskManagerSlot slot = slots.get(slotId); if (null != slot) { if (slot.getState() == TaskManagerSlot.State.ALLOCATED) { if (Objects.equals(allocationId, slot.getAllocationId())) { TaskManagerRegistration taskManagerRegistration = taskManagerR...
SlotManager implements AutoCloseable { public void freeSlot(SlotID slotId, AllocationID allocationId) { checkInit(); TaskManagerSlot slot = slots.get(slotId); if (null != slot) { if (slot.getState() == TaskManagerSlot.State.ALLOCATED) { if (Objects.equals(allocationId, slot.getAllocationId())) { TaskManagerRegistration...
SlotManager implements AutoCloseable { public void freeSlot(SlotID slotId, AllocationID allocationId) { checkInit(); TaskManagerSlot slot = slots.get(slotId); if (null != slot) { if (slot.getState() == TaskManagerSlot.State.ALLOCATED) { if (Objects.equals(allocationId, slot.getAllocationId())) { TaskManagerRegistration...
SlotManager implements AutoCloseable { public void freeSlot(SlotID slotId, AllocationID allocationId) { checkInit(); TaskManagerSlot slot = slots.get(slotId); if (null != slot) { if (slot.getState() == TaskManagerSlot.State.ALLOCATED) { if (Objects.equals(allocationId, slot.getAllocationId())) { TaskManagerRegistration...
SlotManager implements AutoCloseable { public void freeSlot(SlotID slotId, AllocationID allocationId) { checkInit(); TaskManagerSlot slot = slots.get(slotId); if (null != slot) { if (slot.getState() == TaskManagerSlot.State.ALLOCATED) { if (Objects.equals(allocationId, slot.getAllocationId())) { TaskManagerRegistration...
@Test public void testDuplicatePendingSlotRequest() throws Exception { final ResourceManagerId resourceManagerId = ResourceManagerId.generate(); final ResourceActions resourceManagerActions = mock(ResourceActions.class); final AllocationID allocationId = new AllocationID(); final ResourceProfile resourceProfile1 = new ...
public boolean registerSlotRequest(SlotRequest slotRequest) throws SlotManagerException { checkInit(); if (checkDuplicateRequest(slotRequest.getAllocationId())) { LOG.debug("Ignoring a duplicate slot request with allocation id {}.", slotRequest.getAllocationId()); return false; } else { PendingSlotRequest pendingSlotRe...
SlotManager implements AutoCloseable { public boolean registerSlotRequest(SlotRequest slotRequest) throws SlotManagerException { checkInit(); if (checkDuplicateRequest(slotRequest.getAllocationId())) { LOG.debug("Ignoring a duplicate slot request with allocation id {}.", slotRequest.getAllocationId()); return false; } ...
SlotManager implements AutoCloseable { public boolean registerSlotRequest(SlotRequest slotRequest) throws SlotManagerException { checkInit(); if (checkDuplicateRequest(slotRequest.getAllocationId())) { LOG.debug("Ignoring a duplicate slot request with allocation id {}.", slotRequest.getAllocationId()); return false; } ...
SlotManager implements AutoCloseable { public boolean registerSlotRequest(SlotRequest slotRequest) throws SlotManagerException { checkInit(); if (checkDuplicateRequest(slotRequest.getAllocationId())) { LOG.debug("Ignoring a duplicate slot request with allocation id {}.", slotRequest.getAllocationId()); return false; } ...
SlotManager implements AutoCloseable { public boolean registerSlotRequest(SlotRequest slotRequest) throws SlotManagerException { checkInit(); if (checkDuplicateRequest(slotRequest.getAllocationId())) { LOG.debug("Ignoring a duplicate slot request with allocation id {}.", slotRequest.getAllocationId()); return false; } ...
@Test public void hasState() { Random random = new Random(0x42); TaskStateSnapshot taskStateSnapshot = new TaskStateSnapshot(); Assert.assertFalse(taskStateSnapshot.hasState()); OperatorSubtaskState emptyOperatorSubtaskState = new OperatorSubtaskState(); Assert.assertFalse(emptyOperatorSubtaskState.hasState()); taskSta...
public boolean hasState() { for (OperatorSubtaskState operatorSubtaskState : subtaskStatesByOperatorID.values()) { if (operatorSubtaskState != null && operatorSubtaskState.hasState()) { return true; } } return false; }
TaskStateSnapshot implements CompositeStateHandle { public boolean hasState() { for (OperatorSubtaskState operatorSubtaskState : subtaskStatesByOperatorID.values()) { if (operatorSubtaskState != null && operatorSubtaskState.hasState()) { return true; } } return false; } }
TaskStateSnapshot implements CompositeStateHandle { public boolean hasState() { for (OperatorSubtaskState operatorSubtaskState : subtaskStatesByOperatorID.values()) { if (operatorSubtaskState != null && operatorSubtaskState.hasState()) { return true; } } return false; } TaskStateSnapshot(); TaskStateSnapshot(int size)...
TaskStateSnapshot implements CompositeStateHandle { public boolean hasState() { for (OperatorSubtaskState operatorSubtaskState : subtaskStatesByOperatorID.values()) { if (operatorSubtaskState != null && operatorSubtaskState.hasState()) { return true; } } return false; } TaskStateSnapshot(); TaskStateSnapshot(int size)...
TaskStateSnapshot implements CompositeStateHandle { public boolean hasState() { for (OperatorSubtaskState operatorSubtaskState : subtaskStatesByOperatorID.values()) { if (operatorSubtaskState != null && operatorSubtaskState.hasState()) { return true; } } return false; } TaskStateSnapshot(); TaskStateSnapshot(int size)...
@Test public void getStateSize() { Random random = new Random(0x42); TaskStateSnapshot taskStateSnapshot = new TaskStateSnapshot(); Assert.assertEquals(0, taskStateSnapshot.getStateSize()); OperatorSubtaskState emptyOperatorSubtaskState = new OperatorSubtaskState(); Assert.assertFalse(emptyOperatorSubtaskState.hasState...
@Override public long getStateSize() { long size = 0L; for (OperatorSubtaskState subtaskState : subtaskStatesByOperatorID.values()) { if (subtaskState != null) { size += subtaskState.getStateSize(); } } return size; }
TaskStateSnapshot implements CompositeStateHandle { @Override public long getStateSize() { long size = 0L; for (OperatorSubtaskState subtaskState : subtaskStatesByOperatorID.values()) { if (subtaskState != null) { size += subtaskState.getStateSize(); } } return size; } }
TaskStateSnapshot implements CompositeStateHandle { @Override public long getStateSize() { long size = 0L; for (OperatorSubtaskState subtaskState : subtaskStatesByOperatorID.values()) { if (subtaskState != null) { size += subtaskState.getStateSize(); } } return size; } TaskStateSnapshot(); TaskStateSnapshot(int size);...
TaskStateSnapshot implements CompositeStateHandle { @Override public long getStateSize() { long size = 0L; for (OperatorSubtaskState subtaskState : subtaskStatesByOperatorID.values()) { if (subtaskState != null) { size += subtaskState.getStateSize(); } } return size; } TaskStateSnapshot(); TaskStateSnapshot(int size);...
TaskStateSnapshot implements CompositeStateHandle { @Override public long getStateSize() { long size = 0L; for (OperatorSubtaskState subtaskState : subtaskStatesByOperatorID.values()) { if (subtaskState != null) { size += subtaskState.getStateSize(); } } return size; } TaskStateSnapshot(); TaskStateSnapshot(int size);...
@Test public void wrapHook() throws Exception { final String id = "id"; Thread thread = Thread.currentThread(); final ClassLoader originalClassLoader = thread.getContextClassLoader(); final ClassLoader userClassLoader = new URLClassLoader(new URL[0]); final Runnable command = spy(new Runnable() { @Override public void ...
public static <T> MasterTriggerRestoreHook<T> wrapHook( MasterTriggerRestoreHook<T> hook, ClassLoader userClassLoader) { return new WrappedMasterHook<>(hook, userClassLoader); }
MasterHooks { public static <T> MasterTriggerRestoreHook<T> wrapHook( MasterTriggerRestoreHook<T> hook, ClassLoader userClassLoader) { return new WrappedMasterHook<>(hook, userClassLoader); } }
MasterHooks { public static <T> MasterTriggerRestoreHook<T> wrapHook( MasterTriggerRestoreHook<T> hook, ClassLoader userClassLoader) { return new WrappedMasterHook<>(hook, userClassLoader); } private MasterHooks(); }
MasterHooks { public static <T> MasterTriggerRestoreHook<T> wrapHook( MasterTriggerRestoreHook<T> hook, ClassLoader userClassLoader) { return new WrappedMasterHook<>(hook, userClassLoader); } private MasterHooks(); static void reset( final Collection<MasterTriggerRestoreHook<?>> hooks, final Logger log); static vo...
MasterHooks { public static <T> MasterTriggerRestoreHook<T> wrapHook( MasterTriggerRestoreHook<T> hook, ClassLoader userClassLoader) { return new WrappedMasterHook<>(hook, userClassLoader); } private MasterHooks(); static void reset( final Collection<MasterTriggerRestoreHook<?>> hooks, final Logger log); static vo...
@Test public void testCanBeSubsumed() throws Exception { CheckpointProperties forced = new CheckpointProperties(true, CheckpointType.SAVEPOINT, false, false, false, false, false); PendingCheckpoint pending = createPendingCheckpoint(forced); assertFalse(pending.canBeSubsumed()); try { pending.abortSubsumed(); fail("Did ...
public boolean canBeSubsumed() { return !props.forceCheckpoint(); }
PendingCheckpoint { public boolean canBeSubsumed() { return !props.forceCheckpoint(); } }
PendingCheckpoint { public boolean canBeSubsumed() { return !props.forceCheckpoint(); } PendingCheckpoint( JobID jobId, long checkpointId, long checkpointTimestamp, Map<ExecutionAttemptID, ExecutionVertex> verticesToConfirm, CheckpointProperties props, CheckpointStorageLocation targetLocation, Exec...
PendingCheckpoint { public boolean canBeSubsumed() { return !props.forceCheckpoint(); } PendingCheckpoint( JobID jobId, long checkpointId, long checkpointTimestamp, Map<ExecutionAttemptID, ExecutionVertex> verticesToConfirm, CheckpointProperties props, CheckpointStorageLocation targetLocation, Exec...
PendingCheckpoint { public boolean canBeSubsumed() { return !props.forceCheckpoint(); } PendingCheckpoint( JobID jobId, long checkpointId, long checkpointTimestamp, Map<ExecutionAttemptID, ExecutionVertex> verticesToConfirm, CheckpointProperties props, CheckpointStorageLocation targetLocation, Exec...
@Test public void validate() { testchain = builder.build(); UserProfileValidationResult results = new UserProfileValidationResult(testchain.validate(updateContext, new UserRepresentationUserProfile(rep))); Assert.assertEquals(true, results.hasFailureOfErrorType("FAKE_FIELD_ERRORKEY")); Assert.assertEquals(false, result...
public List<AttributeValidationResult> validate(UserProfileContext updateContext, UserProfile updatedProfile) { List<AttributeValidationResult> overallResults = new ArrayList<>(); for (AttributeValidator attribute : attributeValidators) { List<ValidationResult> validationResults = new ArrayList<>(); String attributeKey...
ValidationChain { public List<AttributeValidationResult> validate(UserProfileContext updateContext, UserProfile updatedProfile) { List<AttributeValidationResult> overallResults = new ArrayList<>(); for (AttributeValidator attribute : attributeValidators) { List<ValidationResult> validationResults = new ArrayList<>(); S...
ValidationChain { public List<AttributeValidationResult> validate(UserProfileContext updateContext, UserProfile updatedProfile) { List<AttributeValidationResult> overallResults = new ArrayList<>(); for (AttributeValidator attribute : attributeValidators) { List<ValidationResult> validationResults = new ArrayList<>(); S...
ValidationChain { public List<AttributeValidationResult> validate(UserProfileContext updateContext, UserProfile updatedProfile) { List<AttributeValidationResult> overallResults = new ArrayList<>(); for (AttributeValidator attribute : attributeValidators) { List<ValidationResult> validationResults = new ArrayList<>(); S...
ValidationChain { public List<AttributeValidationResult> validate(UserProfileContext updateContext, UserProfile updatedProfile) { List<AttributeValidationResult> overallResults = new ArrayList<>(); for (AttributeValidator attribute : attributeValidators) { List<ValidationResult> validationResults = new ArrayList<>(); S...
@Test public void shouldRetrieveKeycloakSecurityContext() { SimpleHttpFacade facade = new SimpleHttpFacade(new MockHttpServletRequest(), new MockHttpServletResponse()); assertNotNull(facade.getSecurityContext()); }
@Override public KeycloakSecurityContext getSecurityContext() { SecurityContext context = SecurityContextHolder.getContext(); if (context != null && context.getAuthentication() != null) { KeycloakAuthenticationToken authentication = (KeycloakAuthenticationToken) context.getAuthentication(); return authentication.getAcc...
SimpleHttpFacade implements OIDCHttpFacade { @Override public KeycloakSecurityContext getSecurityContext() { SecurityContext context = SecurityContextHolder.getContext(); if (context != null && context.getAuthentication() != null) { KeycloakAuthenticationToken authentication = (KeycloakAuthenticationToken) context.getA...
SimpleHttpFacade implements OIDCHttpFacade { @Override public KeycloakSecurityContext getSecurityContext() { SecurityContext context = SecurityContextHolder.getContext(); if (context != null && context.getAuthentication() != null) { KeycloakAuthenticationToken authentication = (KeycloakAuthenticationToken) context.getA...
SimpleHttpFacade implements OIDCHttpFacade { @Override public KeycloakSecurityContext getSecurityContext() { SecurityContext context = SecurityContextHolder.getContext(); if (context != null && context.getAuthentication() != null) { KeycloakAuthenticationToken authentication = (KeycloakAuthenticationToken) context.getA...
SimpleHttpFacade implements OIDCHttpFacade { @Override public KeycloakSecurityContext getSecurityContext() { SecurityContext context = SecurityContextHolder.getContext(); if (context != null && context.getAuthentication() != null) { KeycloakAuthenticationToken authentication = (KeycloakAuthenticationToken) context.getA...
@Test public void testGetMethod() throws Exception { assertNotNull(request.getMethod()); assertEquals(REQUEST_METHOD, request.getMethod()); }
@Override public String getMethod() { return request.getMethod(); }
WrappedHttpServletRequest implements Request { @Override public String getMethod() { return request.getMethod(); } }
WrappedHttpServletRequest implements Request { @Override public String getMethod() { return request.getMethod(); } WrappedHttpServletRequest(HttpServletRequest request); }
WrappedHttpServletRequest implements Request { @Override public String getMethod() { return request.getMethod(); } WrappedHttpServletRequest(HttpServletRequest request); @Override String getFirstParam(String param); @Override String getMethod(); @Override String getURI(); @Override String getRelativePath(); @Override b...
WrappedHttpServletRequest implements Request { @Override public String getMethod() { return request.getMethod(); } WrappedHttpServletRequest(HttpServletRequest request); @Override String getFirstParam(String param); @Override String getMethod(); @Override String getURI(); @Override String getRelativePath(); @Override b...
@Test public void testGetURI() throws Exception { assertEquals("https: }
@Override public String getURI() { StringBuffer buf = request.getRequestURL(); if (request.getQueryString() != null) { buf.append('?').append(request.getQueryString()); } return buf.toString(); }
WrappedHttpServletRequest implements Request { @Override public String getURI() { StringBuffer buf = request.getRequestURL(); if (request.getQueryString() != null) { buf.append('?').append(request.getQueryString()); } return buf.toString(); } }
WrappedHttpServletRequest implements Request { @Override public String getURI() { StringBuffer buf = request.getRequestURL(); if (request.getQueryString() != null) { buf.append('?').append(request.getQueryString()); } return buf.toString(); } WrappedHttpServletRequest(HttpServletRequest request); }
WrappedHttpServletRequest implements Request { @Override public String getURI() { StringBuffer buf = request.getRequestURL(); if (request.getQueryString() != null) { buf.append('?').append(request.getQueryString()); } return buf.toString(); } WrappedHttpServletRequest(HttpServletRequest request); @Override String getFi...
WrappedHttpServletRequest implements Request { @Override public String getURI() { StringBuffer buf = request.getRequestURL(); if (request.getQueryString() != null) { buf.append('?').append(request.getQueryString()); } return buf.toString(); } WrappedHttpServletRequest(HttpServletRequest request); @Override String getFi...
@Test public void testIsSecure() throws Exception { assertTrue(request.isSecure()); }
@Override public boolean isSecure() { return request.isSecure(); }
WrappedHttpServletRequest implements Request { @Override public boolean isSecure() { return request.isSecure(); } }
WrappedHttpServletRequest implements Request { @Override public boolean isSecure() { return request.isSecure(); } WrappedHttpServletRequest(HttpServletRequest request); }
WrappedHttpServletRequest implements Request { @Override public boolean isSecure() { return request.isSecure(); } WrappedHttpServletRequest(HttpServletRequest request); @Override String getFirstParam(String param); @Override String getMethod(); @Override String getURI(); @Override String getRelativePath(); @Override bo...
WrappedHttpServletRequest implements Request { @Override public boolean isSecure() { return request.isSecure(); } WrappedHttpServletRequest(HttpServletRequest request); @Override String getFirstParam(String param); @Override String getMethod(); @Override String getURI(); @Override String getRelativePath(); @Override bo...
@Test public void testGetQueryParamValue() throws Exception { assertNotNull(request.getQueryParamValue(QUERY_PARM_1)); assertNotNull(request.getQueryParamValue(QUERY_PARM_2)); }
@Override public String getQueryParamValue(String param) { return request.getParameter(param); }
WrappedHttpServletRequest implements Request { @Override public String getQueryParamValue(String param) { return request.getParameter(param); } }
WrappedHttpServletRequest implements Request { @Override public String getQueryParamValue(String param) { return request.getParameter(param); } WrappedHttpServletRequest(HttpServletRequest request); }
WrappedHttpServletRequest implements Request { @Override public String getQueryParamValue(String param) { return request.getParameter(param); } WrappedHttpServletRequest(HttpServletRequest request); @Override String getFirstParam(String param); @Override String getMethod(); @Override String getURI(); @Override String g...
WrappedHttpServletRequest implements Request { @Override public String getQueryParamValue(String param) { return request.getParameter(param); } WrappedHttpServletRequest(HttpServletRequest request); @Override String getFirstParam(String param); @Override String getMethod(); @Override String getURI(); @Override String g...
@Test public void testGetCookie() throws Exception { assertNotNull(request.getCookie(COOKIE_NAME)); }
@Override public Cookie getCookie(String cookieName) { javax.servlet.http.Cookie[] cookies = request.getCookies(); if (cookies == null) { return null; } for (javax.servlet.http.Cookie cookie : request.getCookies()) { if (cookie.getName().equals(cookieName)) { return new Cookie(cookie.getName(), cookie.getValue(), cooki...
WrappedHttpServletRequest implements Request { @Override public Cookie getCookie(String cookieName) { javax.servlet.http.Cookie[] cookies = request.getCookies(); if (cookies == null) { return null; } for (javax.servlet.http.Cookie cookie : request.getCookies()) { if (cookie.getName().equals(cookieName)) { return new Co...
WrappedHttpServletRequest implements Request { @Override public Cookie getCookie(String cookieName) { javax.servlet.http.Cookie[] cookies = request.getCookies(); if (cookies == null) { return null; } for (javax.servlet.http.Cookie cookie : request.getCookies()) { if (cookie.getName().equals(cookieName)) { return new Co...
WrappedHttpServletRequest implements Request { @Override public Cookie getCookie(String cookieName) { javax.servlet.http.Cookie[] cookies = request.getCookies(); if (cookies == null) { return null; } for (javax.servlet.http.Cookie cookie : request.getCookies()) { if (cookie.getName().equals(cookieName)) { return new Co...
WrappedHttpServletRequest implements Request { @Override public Cookie getCookie(String cookieName) { javax.servlet.http.Cookie[] cookies = request.getCookies(); if (cookies == null) { return null; } for (javax.servlet.http.Cookie cookie : request.getCookies()) { if (cookie.getName().equals(cookieName)) { return new Co...
@Test public void testGetCookieCookiesNull() throws Exception { mockHttpServletRequest.setCookies(null); request.getCookie(COOKIE_NAME); }
@Override public Cookie getCookie(String cookieName) { javax.servlet.http.Cookie[] cookies = request.getCookies(); if (cookies == null) { return null; } for (javax.servlet.http.Cookie cookie : request.getCookies()) { if (cookie.getName().equals(cookieName)) { return new Cookie(cookie.getName(), cookie.getValue(), cooki...
WrappedHttpServletRequest implements Request { @Override public Cookie getCookie(String cookieName) { javax.servlet.http.Cookie[] cookies = request.getCookies(); if (cookies == null) { return null; } for (javax.servlet.http.Cookie cookie : request.getCookies()) { if (cookie.getName().equals(cookieName)) { return new Co...
WrappedHttpServletRequest implements Request { @Override public Cookie getCookie(String cookieName) { javax.servlet.http.Cookie[] cookies = request.getCookies(); if (cookies == null) { return null; } for (javax.servlet.http.Cookie cookie : request.getCookies()) { if (cookie.getName().equals(cookieName)) { return new Co...
WrappedHttpServletRequest implements Request { @Override public Cookie getCookie(String cookieName) { javax.servlet.http.Cookie[] cookies = request.getCookies(); if (cookies == null) { return null; } for (javax.servlet.http.Cookie cookie : request.getCookies()) { if (cookie.getName().equals(cookieName)) { return new Co...
WrappedHttpServletRequest implements Request { @Override public Cookie getCookie(String cookieName) { javax.servlet.http.Cookie[] cookies = request.getCookies(); if (cookies == null) { return null; } for (javax.servlet.http.Cookie cookie : request.getCookies()) { if (cookie.getName().equals(cookieName)) { return new Co...
@Test public void testGetHeader() throws Exception { String header = request.getHeader(HEADER_SINGLE_VALUE); assertNotNull(header); assertEquals("baz", header); }
@Override public String getHeader(String name) { return request.getHeader(name); }
WrappedHttpServletRequest implements Request { @Override public String getHeader(String name) { return request.getHeader(name); } }
WrappedHttpServletRequest implements Request { @Override public String getHeader(String name) { return request.getHeader(name); } WrappedHttpServletRequest(HttpServletRequest request); }
WrappedHttpServletRequest implements Request { @Override public String getHeader(String name) { return request.getHeader(name); } WrappedHttpServletRequest(HttpServletRequest request); @Override String getFirstParam(String param); @Override String getMethod(); @Override String getURI(); @Override String getRelativePath...
WrappedHttpServletRequest implements Request { @Override public String getHeader(String name) { return request.getHeader(name); } WrappedHttpServletRequest(HttpServletRequest request); @Override String getFirstParam(String param); @Override String getMethod(); @Override String getURI(); @Override String getRelativePath...
@Test public void testGetHeaders() throws Exception { List<String> headers = request.getHeaders(HEADER_MULTI_VALUE); assertNotNull(headers); assertEquals(2, headers.size()); assertTrue(headers.contains("foo")); assertTrue(headers.contains("bar")); }
@Override public List<String> getHeaders(String name) { Enumeration<String> values = request.getHeaders(name); List<String> array = new ArrayList<String>(); while (values.hasMoreElements()) { array.add(values.nextElement()); } return Collections.unmodifiableList(array); }
WrappedHttpServletRequest implements Request { @Override public List<String> getHeaders(String name) { Enumeration<String> values = request.getHeaders(name); List<String> array = new ArrayList<String>(); while (values.hasMoreElements()) { array.add(values.nextElement()); } return Collections.unmodifiableList(array); } ...
WrappedHttpServletRequest implements Request { @Override public List<String> getHeaders(String name) { Enumeration<String> values = request.getHeaders(name); List<String> array = new ArrayList<String>(); while (values.hasMoreElements()) { array.add(values.nextElement()); } return Collections.unmodifiableList(array); } ...
WrappedHttpServletRequest implements Request { @Override public List<String> getHeaders(String name) { Enumeration<String> values = request.getHeaders(name); List<String> array = new ArrayList<String>(); while (values.hasMoreElements()) { array.add(values.nextElement()); } return Collections.unmodifiableList(array); } ...
WrappedHttpServletRequest implements Request { @Override public List<String> getHeaders(String name) { Enumeration<String> values = request.getHeaders(name); List<String> array = new ArrayList<String>(); while (values.hasMoreElements()) { array.add(values.nextElement()); } return Collections.unmodifiableList(array); } ...
@Test public void testGetInputStream() throws Exception { assertNotNull(request.getInputStream()); }
@Override public InputStream getInputStream() { return getInputStream(false); }
WrappedHttpServletRequest implements Request { @Override public InputStream getInputStream() { return getInputStream(false); } }
WrappedHttpServletRequest implements Request { @Override public InputStream getInputStream() { return getInputStream(false); } WrappedHttpServletRequest(HttpServletRequest request); }
WrappedHttpServletRequest implements Request { @Override public InputStream getInputStream() { return getInputStream(false); } WrappedHttpServletRequest(HttpServletRequest request); @Override String getFirstParam(String param); @Override String getMethod(); @Override String getURI(); @Override String getRelativePath();...
WrappedHttpServletRequest implements Request { @Override public InputStream getInputStream() { return getInputStream(false); } WrappedHttpServletRequest(HttpServletRequest request); @Override String getFirstParam(String param); @Override String getMethod(); @Override String getURI(); @Override String getRelativePath();...
@Test public void shouldReturnProxy1ForConfiguredProxyMappingAlternative() { ProxyMapping proxy = proxyMappings.getProxyFor("www.googleapis.com"); assertThat(proxy.getProxyHost(), is(notNullValue())); assertThat(proxy.getProxyHost().getHostName(), is("proxy1")); }
public ProxyMapping getProxyFor(String hostname) { Objects.requireNonNull(hostname, "hostname"); if (hostnameToProxyCache.containsKey(hostname)) { return hostnameToProxyCache.get(hostname); } ProxyMapping proxyMapping = entries.stream() .filter(e -> e.matches(hostname)) .findFirst() .orElse(null); if (proxyMapping == n...
ProxyMappings { public ProxyMapping getProxyFor(String hostname) { Objects.requireNonNull(hostname, "hostname"); if (hostnameToProxyCache.containsKey(hostname)) { return hostnameToProxyCache.get(hostname); } ProxyMapping proxyMapping = entries.stream() .filter(e -> e.matches(hostname)) .findFirst() .orElse(null); if (p...
ProxyMappings { public ProxyMapping getProxyFor(String hostname) { Objects.requireNonNull(hostname, "hostname"); if (hostnameToProxyCache.containsKey(hostname)) { return hostnameToProxyCache.get(hostname); } ProxyMapping proxyMapping = entries.stream() .filter(e -> e.matches(hostname)) .findFirst() .orElse(null); if (p...
ProxyMappings { public ProxyMapping getProxyFor(String hostname) { Objects.requireNonNull(hostname, "hostname"); if (hostnameToProxyCache.containsKey(hostname)) { return hostnameToProxyCache.get(hostname); } ProxyMapping proxyMapping = entries.stream() .filter(e -> e.matches(hostname)) .findFirst() .orElse(null); if (p...
ProxyMappings { public ProxyMapping getProxyFor(String hostname) { Objects.requireNonNull(hostname, "hostname"); if (hostnameToProxyCache.containsKey(hostname)) { return hostnameToProxyCache.get(hostname); } ProxyMapping proxyMapping = entries.stream() .filter(e -> e.matches(hostname)) .findFirst() .orElse(null); if (p...
@Test public void testGetRemoteAddr() throws Exception { assertNotNull(request.getRemoteAddr()); }
@Override public String getRemoteAddr() { return request.getRemoteAddr(); }
WrappedHttpServletRequest implements Request { @Override public String getRemoteAddr() { return request.getRemoteAddr(); } }
WrappedHttpServletRequest implements Request { @Override public String getRemoteAddr() { return request.getRemoteAddr(); } WrappedHttpServletRequest(HttpServletRequest request); }
WrappedHttpServletRequest implements Request { @Override public String getRemoteAddr() { return request.getRemoteAddr(); } WrappedHttpServletRequest(HttpServletRequest request); @Override String getFirstParam(String param); @Override String getMethod(); @Override String getURI(); @Override String getRelativePath(); @Ov...
WrappedHttpServletRequest implements Request { @Override public String getRemoteAddr() { return request.getRemoteAddr(); } WrappedHttpServletRequest(HttpServletRequest request); @Override String getFirstParam(String param); @Override String getMethod(); @Override String getURI(); @Override String getRelativePath(); @Ov...
@Test public void testPostProcessHttpRequest() throws Exception { factory.postProcessHttpRequest(request); verify(factory).getKeycloakSecurityContext(); verify(request).setHeader(eq(KeycloakClientRequestFactory.AUTHORIZATION_HEADER), eq("Bearer " + bearerTokenString)); }
@Override protected void postProcessHttpRequest(HttpUriRequest request) { KeycloakSecurityContext context = this.getKeycloakSecurityContext(); request.setHeader(AUTHORIZATION_HEADER, "Bearer " + context.getTokenString()); }
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { @Override protected void postProcessHttpRequest(HttpUriRequest request) { KeycloakSecurityContext context = this.getKeycloakSecurityContext(); request.setHeader(AUTHORIZATION_HEADER, "Bearer " + context.get...
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { @Override protected void postProcessHttpRequest(HttpUriRequest request) { KeycloakSecurityContext context = this.getKeycloakSecurityContext(); request.setHeader(AUTHORIZATION_HEADER, "Bearer " + context.get...
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { @Override protected void postProcessHttpRequest(HttpUriRequest request) { KeycloakSecurityContext context = this.getKeycloakSecurityContext(); request.setHeader(AUTHORIZATION_HEADER, "Bearer " + context.get...
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { @Override protected void postProcessHttpRequest(HttpUriRequest request) { KeycloakSecurityContext context = this.getKeycloakSecurityContext(); request.setHeader(AUTHORIZATION_HEADER, "Bearer " + context.get...
@Test public void testGetKeycloakSecurityContext() throws Exception { KeycloakSecurityContext context = factory.getKeycloakSecurityContext(); assertNotNull(context); assertEquals(keycloakSecurityContext, context); }
protected KeycloakSecurityContext getKeycloakSecurityContext() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); KeycloakAuthenticationToken token; KeycloakSecurityContext context; if (authentication == null) { throw new IllegalStateException("Cannot set authorization header beca...
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { protected KeycloakSecurityContext getKeycloakSecurityContext() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); KeycloakAuthenticationToken token; KeycloakSecurityCo...
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { protected KeycloakSecurityContext getKeycloakSecurityContext() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); KeycloakAuthenticationToken token; KeycloakSecurityCo...
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { protected KeycloakSecurityContext getKeycloakSecurityContext() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); KeycloakAuthenticationToken token; KeycloakSecurityCo...
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { protected KeycloakSecurityContext getKeycloakSecurityContext() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); KeycloakAuthenticationToken token; KeycloakSecurityCo...
@Test(expected = IllegalStateException.class) public void testGetKeycloakSecurityContextInvalidAuthentication() throws Exception { SecurityContextHolder.getContext().setAuthentication( new PreAuthenticatedAuthenticationToken("foo", "bar", Collections.singleton(new KeycloakRole("baz")))); factory.getKeycloakSecurityCont...
protected KeycloakSecurityContext getKeycloakSecurityContext() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); KeycloakAuthenticationToken token; KeycloakSecurityContext context; if (authentication == null) { throw new IllegalStateException("Cannot set authorization header beca...
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { protected KeycloakSecurityContext getKeycloakSecurityContext() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); KeycloakAuthenticationToken token; KeycloakSecurityCo...
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { protected KeycloakSecurityContext getKeycloakSecurityContext() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); KeycloakAuthenticationToken token; KeycloakSecurityCo...
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { protected KeycloakSecurityContext getKeycloakSecurityContext() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); KeycloakAuthenticationToken token; KeycloakSecurityCo...
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { protected KeycloakSecurityContext getKeycloakSecurityContext() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); KeycloakAuthenticationToken token; KeycloakSecurityCo...
@Test(expected = IllegalStateException.class) public void testGetKeycloakSecurityContextNullAuthentication() throws Exception { SecurityContextHolder.clearContext(); factory.getKeycloakSecurityContext(); }
protected KeycloakSecurityContext getKeycloakSecurityContext() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); KeycloakAuthenticationToken token; KeycloakSecurityContext context; if (authentication == null) { throw new IllegalStateException("Cannot set authorization header beca...
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { protected KeycloakSecurityContext getKeycloakSecurityContext() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); KeycloakAuthenticationToken token; KeycloakSecurityCo...
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { protected KeycloakSecurityContext getKeycloakSecurityContext() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); KeycloakAuthenticationToken token; KeycloakSecurityCo...
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { protected KeycloakSecurityContext getKeycloakSecurityContext() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); KeycloakAuthenticationToken token; KeycloakSecurityCo...
KeycloakClientRequestFactory extends HttpComponentsClientHttpRequestFactory implements ClientHttpRequestFactory { protected KeycloakSecurityContext getKeycloakSecurityContext() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); KeycloakAuthenticationToken token; KeycloakSecurityCo...
@Test public void test() { Constructor constructor = JBossWebPrincipalFactory.findJBossGenericPrincipalConstructor(); Assert.assertNotNull(constructor); Assert.assertEquals(Realm.class, constructor.getParameterTypes()[0]); Assert.assertEquals(String.class, constructor.getParameterTypes()[1]); Assert.assertEquals(List.c...
static Constructor findJBossGenericPrincipalConstructor() { for (Constructor<?> c : JBossGenericPrincipal.class.getConstructors()) { if (c.getParameterTypes().length == 9 && c.getParameterTypes()[0].equals(Realm.class) && c.getParameterTypes()[1].equals(String.class) && c.getParameterTypes()[3].equals(List.class) && c....
JBossWebPrincipalFactory extends GenericPrincipalFactory { static Constructor findJBossGenericPrincipalConstructor() { for (Constructor<?> c : JBossGenericPrincipal.class.getConstructors()) { if (c.getParameterTypes().length == 9 && c.getParameterTypes()[0].equals(Realm.class) && c.getParameterTypes()[1].equals(String....
JBossWebPrincipalFactory extends GenericPrincipalFactory { static Constructor findJBossGenericPrincipalConstructor() { for (Constructor<?> c : JBossGenericPrincipal.class.getConstructors()) { if (c.getParameterTypes().length == 9 && c.getParameterTypes()[0].equals(Realm.class) && c.getParameterTypes()[1].equals(String....
JBossWebPrincipalFactory extends GenericPrincipalFactory { static Constructor findJBossGenericPrincipalConstructor() { for (Constructor<?> c : JBossGenericPrincipal.class.getConstructors()) { if (c.getParameterTypes().length == 9 && c.getParameterTypes()[0].equals(Realm.class) && c.getParameterTypes()[1].equals(String....
JBossWebPrincipalFactory extends GenericPrincipalFactory { static Constructor findJBossGenericPrincipalConstructor() { for (Constructor<?> c : JBossGenericPrincipal.class.getConstructors()) { if (c.getParameterTypes().length == 9 && c.getParameterTypes()[0].equals(Realm.class) && c.getParameterTypes()[1].equals(String....
@Test public void testGetKeycloakSecurityContext() throws Exception { KeycloakSecurityContext context = factory.getKeycloakSecurityContext(); assertNotNull(context); assertEquals(keycloakSecurityContext, context); }
protected KeycloakSecurityContext getKeycloakSecurityContext() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); Principal principal = attributes.getRequest().getUserPrincipal(); if (principal == null) { throw new IllegalStateException("Cannot set authorizat...
KeycloakSecurityContextClientRequestInterceptor implements ClientHttpRequestInterceptor { protected KeycloakSecurityContext getKeycloakSecurityContext() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); Principal principal = attributes.getRequest().getUserPr...
KeycloakSecurityContextClientRequestInterceptor implements ClientHttpRequestInterceptor { protected KeycloakSecurityContext getKeycloakSecurityContext() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); Principal principal = attributes.getRequest().getUserPr...
KeycloakSecurityContextClientRequestInterceptor implements ClientHttpRequestInterceptor { protected KeycloakSecurityContext getKeycloakSecurityContext() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); Principal principal = attributes.getRequest().getUserPr...
KeycloakSecurityContextClientRequestInterceptor implements ClientHttpRequestInterceptor { protected KeycloakSecurityContext getKeycloakSecurityContext() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); Principal principal = attributes.getRequest().getUserPr...
@Test(expected = IllegalStateException.class) public void testGetKeycloakSecurityContextInvalidPrincipal() throws Exception { servletRequest.setUserPrincipal(new MarkerPrincipal()); factory.getKeycloakSecurityContext(); }
protected KeycloakSecurityContext getKeycloakSecurityContext() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); Principal principal = attributes.getRequest().getUserPrincipal(); if (principal == null) { throw new IllegalStateException("Cannot set authorizat...
KeycloakSecurityContextClientRequestInterceptor implements ClientHttpRequestInterceptor { protected KeycloakSecurityContext getKeycloakSecurityContext() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); Principal principal = attributes.getRequest().getUserPr...
KeycloakSecurityContextClientRequestInterceptor implements ClientHttpRequestInterceptor { protected KeycloakSecurityContext getKeycloakSecurityContext() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); Principal principal = attributes.getRequest().getUserPr...
KeycloakSecurityContextClientRequestInterceptor implements ClientHttpRequestInterceptor { protected KeycloakSecurityContext getKeycloakSecurityContext() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); Principal principal = attributes.getRequest().getUserPr...
KeycloakSecurityContextClientRequestInterceptor implements ClientHttpRequestInterceptor { protected KeycloakSecurityContext getKeycloakSecurityContext() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); Principal principal = attributes.getRequest().getUserPr...
@Test(expected = IllegalStateException.class) public void testGetKeycloakSecurityContextNullAuthentication() throws Exception { servletRequest.setUserPrincipal(null); factory.getKeycloakSecurityContext(); }
protected KeycloakSecurityContext getKeycloakSecurityContext() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); Principal principal = attributes.getRequest().getUserPrincipal(); if (principal == null) { throw new IllegalStateException("Cannot set authorizat...
KeycloakSecurityContextClientRequestInterceptor implements ClientHttpRequestInterceptor { protected KeycloakSecurityContext getKeycloakSecurityContext() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); Principal principal = attributes.getRequest().getUserPr...
KeycloakSecurityContextClientRequestInterceptor implements ClientHttpRequestInterceptor { protected KeycloakSecurityContext getKeycloakSecurityContext() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); Principal principal = attributes.getRequest().getUserPr...
KeycloakSecurityContextClientRequestInterceptor implements ClientHttpRequestInterceptor { protected KeycloakSecurityContext getKeycloakSecurityContext() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); Principal principal = attributes.getRequest().getUserPr...
KeycloakSecurityContextClientRequestInterceptor implements ClientHttpRequestInterceptor { protected KeycloakSecurityContext getKeycloakSecurityContext() { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); Principal principal = attributes.getRequest().getUserPr...
@Test public void interceptorIsAddedToRequest() { RestTemplate restTemplate = new RestTemplate(); customizer.customize(restTemplate); assertTrue(restTemplate.getInterceptors().contains(interceptor)); }
@Override public void customize(RestTemplate restTemplate) { restTemplate.getInterceptors().add(keycloakInterceptor); }
KeycloakRestTemplateCustomizer implements RestTemplateCustomizer { @Override public void customize(RestTemplate restTemplate) { restTemplate.getInterceptors().add(keycloakInterceptor); } }
KeycloakRestTemplateCustomizer implements RestTemplateCustomizer { @Override public void customize(RestTemplate restTemplate) { restTemplate.getInterceptors().add(keycloakInterceptor); } KeycloakRestTemplateCustomizer(); protected KeycloakRestTemplateCustomizer( KeycloakSecurityContextClientRequestIntercep...
KeycloakRestTemplateCustomizer implements RestTemplateCustomizer { @Override public void customize(RestTemplate restTemplate) { restTemplate.getInterceptors().add(keycloakInterceptor); } KeycloakRestTemplateCustomizer(); protected KeycloakRestTemplateCustomizer( KeycloakSecurityContextClientRequestIntercep...
KeycloakRestTemplateCustomizer implements RestTemplateCustomizer { @Override public void customize(RestTemplate restTemplate) { restTemplate.getInterceptors().add(keycloakInterceptor); } KeycloakRestTemplateCustomizer(); protected KeycloakRestTemplateCustomizer( KeycloakSecurityContextClientRequestIntercep...
@Test public void shouldReturnProxy1ForConfiguredProxyMappingWithSubDomain() { ProxyMapping proxy = proxyMappings.getProxyFor("awesome.account.google.com"); assertThat(proxy.getProxyHost(), is(notNullValue())); assertThat(proxy.getProxyHost().getHostName(), is("proxy1")); }
public ProxyMapping getProxyFor(String hostname) { Objects.requireNonNull(hostname, "hostname"); if (hostnameToProxyCache.containsKey(hostname)) { return hostnameToProxyCache.get(hostname); } ProxyMapping proxyMapping = entries.stream() .filter(e -> e.matches(hostname)) .findFirst() .orElse(null); if (proxyMapping == n...
ProxyMappings { public ProxyMapping getProxyFor(String hostname) { Objects.requireNonNull(hostname, "hostname"); if (hostnameToProxyCache.containsKey(hostname)) { return hostnameToProxyCache.get(hostname); } ProxyMapping proxyMapping = entries.stream() .filter(e -> e.matches(hostname)) .findFirst() .orElse(null); if (p...
ProxyMappings { public ProxyMapping getProxyFor(String hostname) { Objects.requireNonNull(hostname, "hostname"); if (hostnameToProxyCache.containsKey(hostname)) { return hostnameToProxyCache.get(hostname); } ProxyMapping proxyMapping = entries.stream() .filter(e -> e.matches(hostname)) .findFirst() .orElse(null); if (p...
ProxyMappings { public ProxyMapping getProxyFor(String hostname) { Objects.requireNonNull(hostname, "hostname"); if (hostnameToProxyCache.containsKey(hostname)) { return hostnameToProxyCache.get(hostname); } ProxyMapping proxyMapping = entries.stream() .filter(e -> e.matches(hostname)) .findFirst() .orElse(null); if (p...
ProxyMappings { public ProxyMapping getProxyFor(String hostname) { Objects.requireNonNull(hostname, "hostname"); if (hostnameToProxyCache.containsKey(hostname)) { return hostnameToProxyCache.get(hostname); } ProxyMapping proxyMapping = entries.stream() .filter(e -> e.matches(hostname)) .findFirst() .orElse(null); if (p...
@Test public void genericAndSpecificConfigurations() throws Exception { HierarchicalPathBasedKeycloakConfigResolver resolver = new HierarchicalPathBasedKeycloakConfigResolver(); populate(resolver, true); assertThat(resolver.resolve(new MockRequest("http: assertThat(resolver.resolve(new MockRequest("http: assertThat(res...
@Override public KeycloakDeployment resolve(OIDCHttpFacade.Request request) { URI uri = URI.create(request.getURI()); String path = uri.getPath(); if (path != null) { while (path.startsWith("/")) { path = path.substring(1); } String[] segments = path.split("/"); List<String> paths = collectPaths(segments); for (String ...
HierarchicalPathBasedKeycloakConfigResolver extends PathBasedKeycloakConfigResolver { @Override public KeycloakDeployment resolve(OIDCHttpFacade.Request request) { URI uri = URI.create(request.getURI()); String path = uri.getPath(); if (path != null) { while (path.startsWith("/")) { path = path.substring(1); } String[]...
HierarchicalPathBasedKeycloakConfigResolver extends PathBasedKeycloakConfigResolver { @Override public KeycloakDeployment resolve(OIDCHttpFacade.Request request) { URI uri = URI.create(request.getURI()); String path = uri.getPath(); if (path != null) { while (path.startsWith("/")) { path = path.substring(1); } String[]...
HierarchicalPathBasedKeycloakConfigResolver extends PathBasedKeycloakConfigResolver { @Override public KeycloakDeployment resolve(OIDCHttpFacade.Request request) { URI uri = URI.create(request.getURI()); String path = uri.getPath(); if (path != null) { while (path.startsWith("/")) { path = path.substring(1); } String[]...
HierarchicalPathBasedKeycloakConfigResolver extends PathBasedKeycloakConfigResolver { @Override public KeycloakDeployment resolve(OIDCHttpFacade.Request request) { URI uri = URI.create(request.getURI()); String path = uri.getPath(); if (path != null) { while (path.startsWith("/")) { path = path.substring(1); } String[]...