Skip to content
Snippets Groups Projects
Commit f891c845 authored by Jan Kožusznik's avatar Jan Kožusznik
Browse files

code: remove warning

parent b81619af
Branches
Tags
No related merge requests found
Showing
with 132 additions and 226 deletions
......@@ -17,8 +17,8 @@ public class PropertyHolder {
}
public String getValue(String key) {
Properties properties = getProperties();
return properties.getProperty(key);
Properties _properties = getProperties();
return _properties.getProperty(key);
}
public void setValue(String key, String value) {
......
......@@ -37,7 +37,7 @@ public abstract class PersistentSynchronizationProcess<T> {
private final PersistentIndex<T> index;
private final Queue<T> toProcessQueue = new LinkedBlockingQueue<T>();
private final Queue<T> toProcessQueue = new LinkedBlockingQueue<>();
private final Set<Thread> runningTransferThreads = Collections.synchronizedSet(new HashSet<>());
......@@ -107,10 +107,10 @@ public abstract class PersistentSynchronizationProcess<T> {
boolean interrupted = false;
this.notifier.addItem(INIT_TRANSFER_ITEM);
runningTransferThreads.add(Thread.currentThread());
TransferFileProgressForHaaSClient notifier = DUMMY_FILE_PROGRESS;
TransferFileProgressForHaaSClient actualnotifier = DUMMY_FILE_PROGRESS;
try (HaaSFileTransfer tr = fileTransferSupplier.get()) {
try {
tr.setProgress(notifier = getTransferFileProgress(tr));
tr.setProgress(actualnotifier = getTransferFileProgress(tr));
} catch (InterruptedIOException e1) {
interrupted = true;
}
......@@ -125,7 +125,7 @@ public abstract class PersistentSynchronizationProcess<T> {
}
T p = toProcessQueue.poll();
String item = p.toString();
notifier.addItem(item);
actualnotifier.addItem(item);
try {
processItem(tr, p);
fileTransfered(p);
......@@ -133,7 +133,7 @@ public abstract class PersistentSynchronizationProcess<T> {
toProcessQueue.clear();
interrupted = true;
}
notifier.itemDone(item);
actualnotifier.itemDone(item);
} while(true);
} finally {
runningTransferThreads.remove(Thread.currentThread());
......@@ -141,7 +141,7 @@ public abstract class PersistentSynchronizationProcess<T> {
if (startFinished) {
if (!interrupted && !Thread.interrupted()) {
processFinishedNotifier.run();
notifier.done();
actualnotifier.done();
} else {
notifyStop();
reRun.set(false);
......
......@@ -113,8 +113,8 @@ public class Synchronization implements Closeable {
}
private PersistentSynchronizationProcess<Path> createUploadProcess(Supplier<HaaSFileTransfer> fileTransferSupplier,
ExecutorService service, Runnable uploadFinishedNotifier) throws IOException {
return new PersistentSynchronizationProcess<Path>(service, fileTransferSupplier, uploadFinishedNotifier,
ExecutorService executorService, Runnable uploadFinishedNotifier) throws IOException {
return new PersistentSynchronizationProcess<Path>(executorService, fileTransferSupplier, uploadFinishedNotifier,
workingDirectory.resolve(FILE_INDEX_TO_UPLOAD_FILENAME), name -> inputDirectory.resolve(name)) {
@Override
......@@ -147,9 +147,9 @@ public class Synchronization implements Closeable {
}
private P_PersistentDownloadProcess createDownloadProcess(Supplier<HaaSFileTransfer> fileTransferSupplier,
ExecutorService service, Runnable uploadFinishedNotifier) throws IOException {
ExecutorService executorService, Runnable uploadFinishedNotifier) throws IOException {
return new P_PersistentDownloadProcess(service, fileTransferSupplier, uploadFinishedNotifier);
return new P_PersistentDownloadProcess(executorService, fileTransferSupplier, uploadFinishedNotifier);
}
private class P_PersistentDownloadProcess extends PersistentSynchronizationProcess<String> {
......@@ -183,8 +183,8 @@ public class Synchronization implements Closeable {
}
@Override
protected long getTotalSize(Iterable<String> items, HaaSFileTransfer tr) throws InterruptedIOException {
return tr.obtainSize(StreamSupport.stream(items.spliterator(), false).collect(Collectors.toList())).stream()
protected long getTotalSize(Iterable<String> files, HaaSFileTransfer tr) throws InterruptedIOException {
return tr.obtainSize(StreamSupport.stream(files.spliterator(), false).collect(Collectors.toList())).stream()
.collect(Collectors.summingLong(val -> val));
}
......
package cz.it4i.fiji.haas.ui;
import java.awt.Window;
import java.util.function.Supplier;
import org.slf4j.Logger;
......@@ -18,11 +17,8 @@ public abstract class FXFrameNative<T extends Parent&CloseableControl> {
private JFXPanel<T> fxPanel;
private Stage stage;
public FXFrameNative(Supplier<T> fxSupplier) {
this(null,fxSupplier);
}
public FXFrameNative(Window applicationFrame, Supplier<T> fxSupplier) {
public FXFrameNative(Supplier<T> fxSupplier) {
new javafx.embed.swing.JFXPanel();
JavaFXRoutines.runOnFxThread(() -> {
stage = new Stage();
......
......@@ -41,7 +41,7 @@ public class JFXPanel<T extends Parent> extends javafx.embed.swing.JFXPanel {
this.setMinimumSize(dim);
this.setMaximumSize(dim);
this.setPreferredSize(dim);
};
}
public T getControl() {
return control;
......
......@@ -32,9 +32,8 @@ public interface JavaFXRoutines {
try {
if (c.equals(parent.getClass())) {
return parent;
} else {
return c.newInstance();
}
return c.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
throw new RuntimeException(e);
}
......@@ -58,7 +57,7 @@ public interface JavaFXRoutines {
static public <U, T extends ObservableValue<U>, V> void setCellValueFactory(TableView<T> tableView, int index,
Function<U, V> mapper) {
((TableColumn<T, V>) tableView.getColumns().get(index))
.setCellValueFactory(f -> new ObservableValueAdapter<U, V>(f.getValue(), mapper));
.setCellValueFactory(f -> new ObservableValueAdapter<>(f.getValue(), mapper));
}
......@@ -86,9 +85,8 @@ public interface JavaFXRoutines {
public static <T> boolean notNullValue(ObservableValue<T> j, Predicate<T> pred) {
if (j == null || j.getValue() == null) {
return false;
} else {
return pred.test(j.getValue());
}
return pred.test(j.getValue());
}
static public<T,U extends ObservableValue<T>>void setOnDoubleClickAction(TableView<U> tableView ,ExecutorService executorService,Predicate<T> openAllowed, Consumer<T> r) {
......
......@@ -19,9 +19,6 @@ import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
import javax.swing.ScrollPaneConstants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import net.imagej.ui.swing.updater.SwingTools;
import net.imagej.updater.util.Progress;
import net.imagej.updater.util.UpdateCanceledException;
......@@ -30,11 +27,8 @@ import net.imagej.updater.util.UpdateCanceledException;
*
* @author Johannes Schindelin
*/
@SuppressWarnings("serial")
public class ProgressDialog extends JDialog implements Progress {
@SuppressWarnings("unused")
public final static Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas.ui.ProgressDialog.class);
JProgressBar progress;
JButton detailsToggle;
int toggleHeight = -1;
......@@ -80,7 +74,9 @@ public class ProgressDialog extends JDialog implements Progress {
public void actionPerformed(final ActionEvent e) {
canceled = true;
ProgressDialog.this.dispose();
cancelableAction.run();
if (cancelableAction != null) {
cancelableAction.run();
}
}
});
if(canCancel) {
......@@ -260,8 +256,8 @@ public class ProgressDialog extends JDialog implements Progress {
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
}
public void addDetail(final String title) {
addDetail(new Detail(title));
public void addDetail(final String panelTitle) {
addDetail(new Detail(panelTitle));
}
public void addDetail(final Detail detail) {
......
......@@ -69,8 +69,8 @@ public class TableViewContextMenu<T> {
public void handle(ContextMenuEvent event) {
T requestedItem = getRequestedItem();
updateColumnIndex(event.getSceneX());
int columnIndex = getRequestedColumn();
items.forEach(item -> item.updateEnable(requestedItem, columnIndex));
int requestedColumnIndex = getRequestedColumn();
items.forEach(item -> item.updateEnable(requestedItem, requestedColumnIndex));
}
private void updateColumnIndex(double sceneX) {
......@@ -93,7 +93,7 @@ public class TableViewContextMenu<T> {
}
private interface P_Updatable<T> {
public void updateEnable(T selected, int columnIndex);
public void updateEnable(T selected, int enabledColumnIndex);
}
private class P_UpdatableImpl<I extends MenuItem> implements P_Updatable<T> {
......@@ -108,7 +108,7 @@ public class TableViewContextMenu<T> {
}
@Override
public void updateEnable(T selected, int columnIndex) {
public void updateEnable(T selected, int enabledColumnIndex) {
item.setDisable(!enableHandler.test(selected));
}
......@@ -166,8 +166,8 @@ public class TableViewContextMenu<T> {
}
@Override
public void updateEnable(T selected, int columnIndex) {
super.updateEnable(selected, columnIndex);
public void updateEnable(T selected, int enabledColumnIndex) {
super.updateEnable(selected, enabledColumnIndex);
getItem().setSelected(property.apply(selected));
}
......
......@@ -48,12 +48,14 @@ public class UpdatableObservableValue<T> extends ObservableValueBase<T> {
if (oldState == null && state != null || oldState != null && (state == null || !oldState.equals(state))) {
fire = true;
}
case Updated:
//$FALL-THROUGH$
case Updated:
oldState = state;
if (fire) {
fireValueChangedEvent();
}
default:
//$FALL-THROUGH$
default:
return status;
}
......
......@@ -36,6 +36,7 @@
</classpathentry>
<classpathentry kind="src" output="target/classes" path="target/generated-sources/wsimport">
<attributes>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
......
package cz.it4i.fiji.haas_java_client;
import com.jcraft.jsch.JSchException;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
......@@ -26,8 +28,6 @@ import javax.xml.rpc.ServiceException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.jcraft.jsch.JSchException;
import cz.it4i.fiji.haas_java_client.proxy.ArrayOfCommandTemplateParameterValueExt;
import cz.it4i.fiji.haas_java_client.proxy.ArrayOfEnvironmentVariableExt;
import cz.it4i.fiji.haas_java_client.proxy.ArrayOfTaskFileOffsetExt;
......@@ -172,7 +172,7 @@ public class HaaSClient {
final static private Map<JobStateExt, JobState> WS_STATE2STATE;
static {
Map<JobStateExt, JobState> map = new HashMap<JobStateExt, JobState>();
Map<JobStateExt, JobState> map = new HashMap<>();
map.put(JobStateExt.CANCELED, JobState.Canceled);
map.put(JobStateExt.CONFIGURING, JobState.Configuring);
map.put(JobStateExt.FAILED, JobState.Failed);
......@@ -189,7 +189,7 @@ public class HaaSClient {
private JobManagementWsSoap jobManagement;
private FileTransferWsSoap fileTransfer;
private FileTransferWsSoap fileTransferWS;
private final String projectId;
......@@ -206,12 +206,8 @@ public class HaaSClient {
this.projectId = settings.getProjectId();
}
public long createJob(JobSettings settings, Collection<Entry<String, String>> templateParameters) {
try {
return doCreateJob(settings, templateParameters);
} catch (RemoteException | ServiceException e) {
throw new RuntimeException(e);
}
public long createJob(JobSettings jobSettings, Collection<Entry<String, String>> templateParameters) {
return doCreateJob(jobSettings, templateParameters);
}
public HaaSFileTransfer startFileTransfer(long jobId, TransferFileProgress notifier) {
......@@ -227,9 +223,9 @@ public class HaaSClient {
}
public TunnelToNode openTunnel(long jobId, String nodeIP, int localPort, int remotePort) {
MidlewareTunnel tunnel;
MiddlewareTunnel tunnel;
try {
tunnel = new MidlewareTunnel(Executors.newCachedThreadPool(), jobId, nodeIP, getSessionID());
tunnel = new MiddlewareTunnel(Executors.newCachedThreadPool(), jobId, nodeIP, getSessionID());
tunnel.open(localPort, remotePort);
return new TunnelToNode() {
@Override
......@@ -247,113 +243,85 @@ public class HaaSClient {
return tunnel.getLocalHost();
}
};
} catch (ServiceException | IOException e) {
} catch (IOException e) {
log.error(e.getMessage(), e);
throw new HaaSClientException(e);
}
}
public void submitJob(long jobId) {
try {
doSubmitJob(jobId);
} catch (RemoteException | ServiceException e) {
throw new HaaSClientException(e);
}
doSubmitJob(jobId);
}
public JobInfo obtainJobInfo(long jobId) {
try {
final SubmittedJobInfoExt info = getJobManagement().getCurrentInfoForJob(jobId, getSessionID());
final SubmittedJobInfoExt info = getJobManagement().getCurrentInfoForJob(jobId, getSessionID());
final Collection<Long> tasksId = info.getTasks().getSubmittedTaskInfoExt().stream().map(ti -> ti.getId())
.collect(Collectors.toList());
return new JobInfo() {
private List<String> ips;
final Collection<Long> tasksId = info.getTasks().getSubmittedTaskInfoExt().stream().map(ti -> ti.getId())
.collect(Collectors.toList());
return new JobInfo() {
private List<String> ips;
@Override
public Collection<Long> getTasks() {
return tasksId;
}
@Override
public Collection<Long> getTasks() {
return tasksId;
}
@Override
public JobState getState() {
return WS_STATE2STATE.get(info.getState());
}
@Override
public JobState getState() {
return WS_STATE2STATE.get(info.getState());
}
@Override
public java.util.Calendar getStartTime() {
return toGregorian(info.getStartTime());
};
@Override
public java.util.Calendar getStartTime() {
return toGregorian(info.getStartTime());
}
@Override
public java.util.Calendar getEndTime() {
return toGregorian(info.getEndTime());
};
@Override
public java.util.Calendar getEndTime() {
return toGregorian(info.getEndTime());
}
@Override
public Calendar getCreationTime() {
return toGregorian(info.getCreationTime());
};
@Override
public Calendar getCreationTime() {
return toGregorian(info.getCreationTime());
}
@Override
public List<String> getNodesIPs() {
if (ips == null) {
try {
ips = getJobManagement().getAllocatedNodesIPs(jobId, getSessionID()).getString().stream()
.collect(Collectors.toList());
} catch (RemoteException | ServiceException e) {
log.error(e.getMessage(), e);
}
}
return ips;
}
};
} catch (RemoteException | ServiceException e) {
throw new HaaSClientException(e);
}
@Override
public List<String> getNodesIPs() {
if (ips == null) {
ips = getJobManagement().getAllocatedNodesIPs(jobId, getSessionID())
.getString().stream().collect(Collectors.toList());
}
return ips;
}
};
}
public Collection<JobFileContentExt> downloadPartsOfJobFiles(Long jobId, HaaSClient.SynchronizableFiles files) {
try {
ArrayOfTaskFileOffsetExt fileOffsetExt = new ArrayOfTaskFileOffsetExt();
fileOffsetExt.getTaskFileOffsetExt().addAll(files.getFiles());
return getFileTransfer().downloadPartsOfJobFilesFromCluster(jobId, fileOffsetExt, getSessionID())
.getJobFileContentExt();
} catch (RemoteException | ServiceException e) {
throw new HaaSClientException(e);
}
ArrayOfTaskFileOffsetExt fileOffsetExt = new ArrayOfTaskFileOffsetExt();
fileOffsetExt.getTaskFileOffsetExt().addAll(files.getFiles());
return getFileTransfer().downloadPartsOfJobFilesFromCluster(jobId, fileOffsetExt, getSessionID())
.getJobFileContentExt();
}
public Collection<String> getChangedFiles(long jobId) {
try {
return getFileTransfer().listChangedFilesForJob(jobId, getSessionID()).getString();
} catch (RemoteException | ServiceException e) {
throw new HaaSClientException(e);
}
return getFileTransfer().listChangedFilesForJob(jobId, getSessionID()).getString();
}
public void cancelJob(Long jobId) {
try {
getJobManagement().cancelJob(jobId, getSessionID());
} catch (RemoteException | ServiceException e) {
throw new HaaSClientException(e);
}
getJobManagement().cancelJob(jobId, getSessionID());
}
public void deleteJob(long id) {
try {
getJobManagement().deleteJob(id, getSessionID());
} catch (RemoteException | ServiceException e) {
throw new HaaSClientException(e);
}
getJobManagement().deleteJob(id, getSessionID());
}
public HaaSDataTransfer startDataTransfer(long jobId, int nodeNumber, int port) throws RemoteException, ServiceException {
public HaaSDataTransfer startDataTransfer(long jobId, int nodeNumber, int port) {
return createDataTransfer(jobId, nodeNumber, port);
}
synchronized String getSessionID() throws RemoteException, ServiceException {
synchronized String getSessionID() {
if (sessionID == null) {
sessionID = authenticate();
}
......@@ -374,7 +342,7 @@ public class HaaSClient {
} catch (RemoteException | ServiceException e) {
throw new HaaSClientException(e);
}
};
}
};
} catch (UnsupportedEncodingException | JSchException e) {
pool.release();
......@@ -382,8 +350,7 @@ public class HaaSClient {
}
}
private HaaSDataTransfer createDataTransfer(long jobId, int nodeNumber, int port)
throws ServiceException, RemoteException {
private HaaSDataTransfer createDataTransfer(long jobId, int nodeNumber, int port) {
String host = getJobManagement().getAllocatedNodesIPs(jobId, getSessionID()).getString().get(nodeNumber);
DataTransferWsSoap ws = getDataTransfer();
DataTransferMethodExt dataTransferMethodExt = ws.getDataTransferMethod(host, port, jobId,
......@@ -412,12 +379,11 @@ public class HaaSClient {
}};
}
private void doSubmitJob(long jobId) throws RemoteException, ServiceException {
private void doSubmitJob(long jobId) {
getJobManagement().submitJob(jobId, getSessionID());
}
private long doCreateJob(JobSettings jobSettings, Collection<Entry<String, String>> templateParameters)
throws RemoteException, ServiceException {
private long doCreateJob(JobSettings jobSettings, Collection<Entry<String, String>> templateParameters) {
Collection<TaskSpecificationExt> taskSpec = Arrays
.asList(createTaskSpecification(jobSettings, templateParameters));
JobSpecificationExt jobSpecification = createJobSpecification(jobSettings, taskSpec);
......@@ -480,7 +446,7 @@ public class HaaSClient {
return testTask;
}
private String authenticate() throws RemoteException, ServiceException {
private String authenticate() {
return getUserAndLimitationManagement()
.authenticateUserPassword(createPasswordCredentialsExt(settings.getUserName(), settings.getPassword()));
}
......@@ -492,25 +458,25 @@ public class HaaSClient {
return dataTransferWs;
}
synchronized private UserAndLimitationManagementWsSoap getUserAndLimitationManagement() throws ServiceException {
synchronized private UserAndLimitationManagementWsSoap getUserAndLimitationManagement() {
if (userAndLimitationManagement == null) {
userAndLimitationManagement = new UserAndLimitationManagementWs().getUserAndLimitationManagementWsSoap12();
}
return userAndLimitationManagement;
}
synchronized private JobManagementWsSoap getJobManagement() throws ServiceException {
synchronized private JobManagementWsSoap getJobManagement() {
if (jobManagement == null) {
jobManagement = new JobManagementWs().getJobManagementWsSoap12();
}
return jobManagement;
}
synchronized private FileTransferWsSoap getFileTransfer() throws ServiceException {
if (fileTransfer == null) {
fileTransfer = new FileTransferWs().getFileTransferWsSoap12();
synchronized private FileTransferWsSoap getFileTransfer() {
if (fileTransferWS == null) {
fileTransferWS = new FileTransferWs().getFileTransferWsSoap12();
}
return fileTransfer;
return fileTransferWS;
}
public static class P_ProgressNotifierDecorator4Size extends P_ProgressNotifierDecorator {
......
......@@ -91,7 +91,7 @@ class HaaSFileTransferImp implements HaaSFileTransfer {
List<String> result = new LinkedList<>();
try {
for (String fileName : files) {
fileName = replaceIfFirstFirst(fileName, "/", "");
fileName = replaceIfFirstFirst(fileName);
try (ByteArrayOutputStream os = new ByteArrayOutputStream()) {
String fileToDownload = "'" + ft.getSharedBasepath() + "/" + fileName + "'";
scpClient.download(fileToDownload, os, progress);
......@@ -105,7 +105,7 @@ class HaaSFileTransferImp implements HaaSFileTransfer {
return result;
}
private String replaceIfFirstFirst(String fileName, String string, String string2) {
private String replaceIfFirstFirst(String fileName) {
if (fileName.length() < 0 && fileName.charAt(0) == '/') {
fileName = fileName.substring(1);
}
......
package cz.it4i.fiji.haas_java_client;
import cz.it4i.fiji.haas_java_client.proxy.JobFileContentExt;
import cz.it4i.fiji.haas_java_client.proxy.SynchronizableFilesExt;
class JobFileContentImpl implements JobFileContent{
private final JobFileContentExt contentExt;
public JobFileContentImpl(JobFileContentExt contentExt) {
this.contentExt = contentExt;
}
@Override
public String getContent() {
return contentExt.getContent();
}
@Override
public String getRelativePath() {
return contentExt.getRelativePath();
}
@Override
public Long getOffset() {
return contentExt.getOffset();
}
@Override
public SynchronizableFileType getFileType() {
return getFileType(contentExt.getFileType());
}
@Override
public Long getSubmittedTaskInfoId() {
return contentExt.getSubmittedTaskInfoId();
}
private SynchronizableFileType getFileType(SynchronizableFilesExt fileType) {
// TODO Auto-generated method stub
return null;
}
}
......@@ -20,40 +20,40 @@ public class JobSettingsBuilder {
private static final int DEFAULT_NUMBER_OF_CORES_PER_NODE = 24;
private long templateId = DEFAULT_TEMPLATE;
private int walltimeLimit = DEFAULT_WALLTIME;
private long clusterNodeType = DEFAULT_CLUSTER_NODE_TYPE;
private String jobName = DEFAULT_JOB_NAME;
private int numberOfNodes = DEFAULT_NUMBER_OF_NODES;
private int numberOfCoresPerNode = DEFAULT_NUMBER_OF_CORES_PER_NODE;
private long _templateId = DEFAULT_TEMPLATE;
private int _walltimeLimit = DEFAULT_WALLTIME;
private long _clusterNodeType = DEFAULT_CLUSTER_NODE_TYPE;
private String _jobName = DEFAULT_JOB_NAME;
private int _numberOfNodes = DEFAULT_NUMBER_OF_NODES;
private int _numberOfCoresPerNode = DEFAULT_NUMBER_OF_CORES_PER_NODE;
public JobSettingsBuilder templateId(long templateId) {
this.templateId = templateId;
this._templateId = templateId;
return this;
}
public JobSettingsBuilder walltimeLimit(int walltimeLimit) {
this.walltimeLimit = walltimeLimit;
this._walltimeLimit = walltimeLimit;
return this;
}
public JobSettingsBuilder clusterNodeType(long clusterNodeType) {
this.clusterNodeType = clusterNodeType;
this._clusterNodeType = clusterNodeType;
return this;
}
public JobSettingsBuilder jobName(String jobName) {
this.jobName = jobName;
this._jobName = jobName;
return this;
}
public JobSettingsBuilder numberOfNodes(int numberOfNodes) {
this.numberOfNodes = numberOfNodes;
this._numberOfNodes = numberOfNodes;
return this;
}
public JobSettingsBuilder numberOfCoresPerNode(int numberOfCoresPerNode) {
this.numberOfCoresPerNode = numberOfCoresPerNode;
this._numberOfCoresPerNode = numberOfCoresPerNode;
return this;
}
......@@ -62,32 +62,32 @@ public class JobSettingsBuilder {
@Override
public int getWalltimeLimit() {
return walltimeLimit;
return _walltimeLimit;
}
@Override
public long getTemplateId() {
return templateId;
return _templateId;
}
@Override
public int getNumberOfNodes() {
return numberOfNodes;
return _numberOfNodes;
}
@Override
public String getJobName() {
return jobName;
return _jobName;
}
@Override
public long getClusterNodeType() {
return clusterNodeType;
return _clusterNodeType;
}
@Override
public int getNumberOfCoresPerNode() {
return numberOfCoresPerNode;
return _numberOfCoresPerNode;
}
};
}
......
......@@ -27,9 +27,9 @@ import cz.it4i.fiji.haas_java_client.proxy.DataTransferMethodExt;
import cz.it4i.fiji.haas_java_client.proxy.DataTransferWs;
import cz.it4i.fiji.haas_java_client.proxy.DataTransferWsSoap;
class MidlewareTunnel implements Closeable {
class MiddlewareTunnel implements Closeable {
public static final Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas_java_client.MidlewareTunnel.class);
public static final Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas_java_client.MiddlewareTunnel.class);
private static final int TIMEOUT = 1000;
......@@ -63,7 +63,7 @@ class MidlewareTunnel implements Closeable {
private DataTransferMethodExt dataTransferMethod;
public MidlewareTunnel(ExecutorService executorService, long jobId, String hostIp, String sessionCode) {
public MiddlewareTunnel(ExecutorService executorService, long jobId, String hostIp, String sessionCode) {
this.jobId = jobId;
this.dataTransfer = new DataTransferWs().getDataTransferWsSoap12();
((BindingProvider) dataTransfer).getRequestContext().put("javax.xml.ws.client.connectionTimeout", "" + TIMEOUT);
......@@ -93,7 +93,7 @@ class MidlewareTunnel implements Closeable {
while (!Thread.interrupted() && !ss.isClosed()) {
try (Socket soc = ss.accept()) {
obtainTransferMethodIfNeeded(port);
doTransfer(soc, port);
doTransfer(soc);
if (log.isDebugEnabled()) {
log.debug("endDataTransfer");
}
......@@ -159,7 +159,7 @@ class MidlewareTunnel implements Closeable {
}
}
private void doTransfer(Socket soc, int port) {
private void doTransfer(Socket soc) {
log.debug("START: doTransfer");
if(lastConnection != null) {
lastConnection.finishIfNeeded();
......@@ -254,7 +254,6 @@ class MidlewareTunnel implements Closeable {
zeroCounter = 0;
}
}
;
return true;
}
......
......@@ -19,9 +19,9 @@ public class TransferFileProgressForHaaSClient implements TransferFileProgress {
this.notifier = notifier;
}
public void startNewFile(long fileSize) {
public void startNewFile(long initialFileSize) {
fileTransfered = 0;
this.fileSize = fileSize;
this.fileSize = initialFileSize;
}
@Override
......
package cz.it4i.fiji.haas_java_client;
import java.io.IOException;
import javax.xml.rpc.ServiceException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -18,7 +14,7 @@ public class GetJobInfo {
public static Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas_java_client.GetJobInfo.class);
public static void main(String[] args) throws ServiceException, IOException {
public static void main(String[] args) {
HaaSClientSettings settings = SettingsProvider.getSettings("OPEN-12-20", TestingConstants.CONFIGURATION_FILE_NAME);
HaaSClient client = new HaaSClient(settings);
JobInfo ji = client.obtainJobInfo(334);
......
......@@ -3,8 +3,6 @@ package cz.it4i.fiji.haas_java_client;
import java.io.IOException;
import java.util.Scanner;
import javax.xml.rpc.ServiceException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -15,7 +13,7 @@ public class TestCommunicationWithNodes {
private static String[] predefined = new String[2];
@SuppressWarnings("resource")
public static void main(String[] args) throws ServiceException, IOException, InterruptedException {
public static void main(String[] args) throws IOException, InterruptedException {
predefined[0] = "POST /modules/'command:net.imagej.ops.math.PrimitiveMath$IntegerAdd'?process=false HTTP/1.1\r\n" +
"Content-Type: application/json\r\n" +
"Host: localhost:8080\r\n" +
......
......@@ -3,8 +3,6 @@ package cz.it4i.fiji.haas_java_client;
import java.io.IOException;
import java.util.Arrays;
import javax.xml.rpc.ServiceException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -12,7 +10,8 @@ public class TestConcurentAccessToHaaSFileTransfer {
private static Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas_java_client.TestConcurentAccessToHaaSFileTransfer.class);
public static void main(String[] args) throws ServiceException, IOException {
@SuppressWarnings("resource")
public static void main(String[] args) throws IOException {
HaaSClient client = new HaaSClient(SettingsProvider.getSettings("OPEN-12-20",TestingConstants.CONFIGURATION_FILE_NAME));
HaaSFileTransfer tr1 = client.startFileTransfer(250, HaaSClient.DUMMY_TRANSFER_FILE_PROGRESS);
HaaSFileTransfer tr2 = client.startFileTransfer(249, HaaSClient.DUMMY_TRANSFER_FILE_PROGRESS);
......
......@@ -9,8 +9,6 @@ import java.nio.file.Paths;
import java.util.HashMap;
import java.util.Map;
import javax.xml.rpc.ServiceException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -21,7 +19,7 @@ public class TestHaaSJavaClient {
private static Logger log = LoggerFactory.getLogger(cz.it4i.fiji.haas_java_client.TestHaaSJavaClient.class);
public static void main(String[] args) throws ServiceException, IOException {
public static void main(String[] args) throws IOException {
Map<String, String> params = new HashMap<>();
params.put("inputParam", "someStringParam");
Path baseDir = Paths.get("/home/koz01/aaa");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment