Skip to content

Commit

Permalink
Reformat new code per official DCache style
Browse files Browse the repository at this point in the history
  • Loading branch information
greenc-FNAL committed Sep 23, 2024
1 parent adc0be5 commit 918e54b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package diskCacheV111.vehicles;

import static java.util.Objects.requireNonNull;

import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static java.util.Objects.requireNonNull;

public class PoolManagerGetPoolsByPoolGroupOfPoolMessage
extends Message {

Expand All @@ -26,19 +26,19 @@ public String getPoolName() {
return _poolName;
}

public void setPoolsMap(Map<String, List<PoolManagerPoolInformation>> poolsMap) {
_poolsMap = new HashMap<>(poolsMap);
}

public void setOfflinePools(Collection<String> _offlinePools) {
this._offlinePools = _offlinePools;
}

public Map<String, List<PoolManagerPoolInformation>> getPoolsMap() {
return _poolsMap;
}

public void setPoolsMap(Map<String, List<PoolManagerPoolInformation>> poolsMap) {
_poolsMap = new HashMap<>(poolsMap);
}

public Collection<String> getOfflinePools() {
return (_offlinePools == null) ? Collections.emptyList() : _offlinePools;
}

public void setOfflinePools(Collection<String> _offlinePools) {
this._offlinePools = _offlinePools;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -538,11 +538,11 @@ public class MigrationCopyCommand implements Callable<String> {
boolean forceSourceMode;

@Argument(metaVar = "target",
required = false,
usage = "Required unless -target=pgroup is supplied, in which case we" +
"default to the unique pool group of which the source pool is a member," +
"if such exists.")
String[] targets = {};
required = false,
usage = "Required unless -target=pgroup is supplied, in which case we" +
"default to the unique pool group of which the source pool is a member," +
"if such exists.")
String[] targets = {};

@CommandLine
String commandLine;
Expand All @@ -562,7 +562,7 @@ private RefreshablePoolList createPoolList(String type, List<String> targets) {
}
case "link":
if (targets.size() != 1) {
throw new IllegalArgumentException(targets.toString() +
throw new IllegalArgumentException(targets +
": Only one target supported for -type=link");
}
return new PoolListByLink(poolManager, targets.get(0));
Expand Down Expand Up @@ -809,8 +809,9 @@ public String call() throws IllegalArgumentException {
createPoolPredicate(includeWhen, TRUE_EXPRESSION);

List<String> targets_list = asList(targets);
if (targets_list.isEmpty() && ! target.equals("pgroup")) {
throw new IllegalArgumentException("target(s) required when target type is " + target);
if (targets_list.isEmpty() && !target.equals("pgroup")) {
throw new IllegalArgumentException(
"target(s) required when target type is " + target);
}

RefreshablePoolList poolList =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,20 @@
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.util.concurrent.MoreExecutors;
import diskCacheV111.vehicles.Pool;
import diskCacheV111.vehicles.PoolManagerGetPoolsByPoolGroupOfPoolMessage;
import diskCacheV111.vehicles.PoolManagerPoolInformation;
import java.util.List;
import org.dcache.cells.AbstractMessageCallback;
import org.dcache.cells.CellStub;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

class PoolListByPoolGroupOfPool
extends AbstractMessageCallback<PoolManagerGetPoolsByPoolGroupOfPoolMessage>
implements RefreshablePoolList {
extends AbstractMessageCallback<PoolManagerGetPoolsByPoolGroupOfPoolMessage>
implements RefreshablePoolList {

private static final Logger LOGGER =
LoggerFactory.getLogger(PoolListByPoolGroupOfPool.class);
LoggerFactory.getLogger(PoolListByPoolGroupOfPool.class);

private final CellStub _poolManager;
private final String _poolName;
Expand All @@ -47,8 +45,8 @@ public ImmutableList<String> getOfflinePools() {
@Override
public ImmutableList<PoolManagerPoolInformation> getPools() {
return _poolsMap.isEmpty() ?
ImmutableList.of() :
ImmutableList.copyOf(_poolsMap.values().iterator().next());
ImmutableList.of() :
ImmutableList.copyOf(_poolsMap.values().iterator().next());
}

@Override
Expand All @@ -61,7 +59,7 @@ public void refresh() {
@Override
public String toString() {
return String.format("source pool %s, %d pools",
_poolName, getPools().size());
_poolName, getPools().size());
}

@Override
Expand Down

0 comments on commit 918e54b

Please sign in to comment.