Skip to content

Commit

Permalink
poolmanager/vehicles: move CostException into dCache-core/poolmanager
Browse files Browse the repository at this point in the history
Motivation:

The CostException is only used by poolmanager when selecting pools.
Therefore, it does not need to be in the dcache-vehicles module.

Moreover, placing CostException in dcache-vehicles makes it harder to
support changes to this exception, as pool-manager private functionality
would need to be placed in the dcache-vehicles module.

Modification:

Simple refactoring of CostException into the 'dcache' module, under the
org.dcache.poolmanager package.

Result:

No user or admin observable changes.

Code is easier to work with.

Target: master
Requires-notes: no
Requires-book: no
Patch: https://rb.dcache.org/r/12821/
Acked-by: Lea Morschel
  • Loading branch information
paulmillar committed Feb 17, 2021
1 parent fd92c84 commit 9314531
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 12 deletions.
Expand Up @@ -29,7 +29,6 @@
import diskCacheV111.poolManager.PoolSelectionUnit.SelectionPool;
import diskCacheV111.pools.PoolCostInfo;
import diskCacheV111.util.CacheException;
import diskCacheV111.util.CostException;
import diskCacheV111.util.FileLocality;
import diskCacheV111.util.FileNotInCacheException;
import diskCacheV111.util.FileNotOnlineCacheException;
Expand All @@ -39,6 +38,7 @@

import org.dcache.namespace.FileAttribute;
import org.dcache.namespace.FileType;
import org.dcache.poolmanager.CostException;
import org.dcache.poolmanager.Partition;
import org.dcache.poolmanager.PartitionManager;
import org.dcache.poolmanager.PoolInfo;
Expand All @@ -49,9 +49,7 @@

import static com.google.common.base.Strings.nullToEmpty;
import static java.util.stream.Collectors.toList;
import static org.dcache.namespace.FileAttribute.LOCATIONS;
import static org.dcache.namespace.FileAttribute.SIZE;
import static org.dcache.namespace.FileAttribute.STORAGEINFO;
import static org.dcache.namespace.FileAttribute.*;

public class PoolMonitorV5
extends SerializablePoolMonitor
Expand Down
Expand Up @@ -35,7 +35,6 @@

import diskCacheV111.util.CacheException;
import diskCacheV111.util.CheckStagePermission;
import diskCacheV111.util.CostException;
import diskCacheV111.util.DestinationCostException;
import diskCacheV111.util.FileNotInCacheException;
import diskCacheV111.util.PermissionDeniedCacheException;
Expand Down Expand Up @@ -72,6 +71,7 @@
import dmg.util.command.Command;

import org.dcache.cells.CellStub;
import org.dcache.poolmanager.CostException;
import org.dcache.poolmanager.Partition;
import org.dcache.poolmanager.PartitionManager;
import org.dcache.poolmanager.PoolInfo;
Expand All @@ -83,10 +83,11 @@
import org.dcache.vehicles.FileAttributes;

import static com.google.common.base.Preconditions.checkArgument;
import static diskCacheV111.poolManager.RequestContainerV5.StateType.TRANSITORY;
import static diskCacheV111.poolManager.RequestContainerV5.StateType.WAITING;
import static dmg.util.CommandException.checkCommand;
import static java.util.stream.Collectors.toList;
import static diskCacheV111.poolManager.RequestContainerV5.StateType.*;
import static java.util.Objects.requireNonNull;
import static java.util.stream.Collectors.toList;
import static org.dcache.util.MathUtils.addWithInfinity;

public class RequestContainerV5
Expand Down
Expand Up @@ -12,7 +12,6 @@

import diskCacheV111.poolManager.CostModule;
import diskCacheV111.util.CacheException;
import diskCacheV111.util.CostException;
import diskCacheV111.util.PnfsId;

import org.dcache.pool.assumption.PerformanceCostAssumption;
Expand Down
@@ -1,4 +1,6 @@
package diskCacheV111.util;
package org.dcache.poolmanager;

import diskCacheV111.util.MissingResourceCacheException;

import org.dcache.poolmanager.SelectedPool;

Expand Down
Expand Up @@ -12,7 +12,6 @@
import diskCacheV111.poolManager.CostModule;
import diskCacheV111.pools.PoolCostInfo.PoolSpaceInfo;
import diskCacheV111.util.CacheException;
import diskCacheV111.util.CostException;

import org.dcache.pool.assumption.AvailableSpaceAssumption;
import org.dcache.vehicles.FileAttributes;
Expand Down
Expand Up @@ -8,7 +8,6 @@
import diskCacheV111.poolManager.CostModule;
import diskCacheV111.pools.PoolCostInfo.PoolSpaceInfo;
import diskCacheV111.util.CacheException;
import diskCacheV111.util.CostException;

import org.dcache.pool.assumption.AvailableSpaceAssumption;
import org.dcache.vehicles.FileAttributes;
Expand Down
Expand Up @@ -8,7 +8,6 @@

import diskCacheV111.poolManager.CostModule;
import diskCacheV111.util.CacheException;
import diskCacheV111.util.CostException;
import diskCacheV111.util.DestinationCostException;
import diskCacheV111.util.PermissionDeniedCacheException;
import diskCacheV111.util.SourceCostException;
Expand Down

0 comments on commit 9314531

Please sign in to comment.