use of diskCacheV111.vehicles.DCapProtocolInfo in project dcache by dCache.
the class PinManagerCLI method pin.
private Future<PinManagerPinMessage> pin(PnfsId pnfsId, String requestId, long lifetime) throws CacheException {
DCapProtocolInfo protocolInfo = new DCapProtocolInfo("DCap", 3, 0, new InetSocketAddress("localhost", 0));
PinManagerPinMessage message = new PinManagerPinMessage(FileAttributes.ofPnfsId(pnfsId), protocolInfo, requestId, lifetime);
return _pinProcessor.messageArrived(message);
}
use of diskCacheV111.vehicles.DCapProtocolInfo in project dcache by dCache.
the class RequestContainerV5 method ac_replicate_$_2.
public String ac_replicate_$_2(Args args) {
String commandReply = "Replication initiated...";
try {
FileAttributes fileAttributes = _pnfsHandler.getFileAttributes(new PnfsId(args.argv(0)), PoolMgrReplicateFileMsg.getRequiredAttributes());
// TODO: call p2p direct
// send message to yourself
PoolMgrReplicateFileMsg req = new PoolMgrReplicateFileMsg(fileAttributes, new DCapProtocolInfo("DCap", 3, 0, new InetSocketAddress(args.argv(1), 2222)));
sendMessage(new CellMessage(new CellAddressCore("PoolManager"), req));
} catch (CacheException e) {
commandReply = "P2P failed : " + e.getMessage();
}
return commandReply;
}
use of diskCacheV111.vehicles.DCapProtocolInfo in project dcache by dCache.
the class LegacyAdminShell method ac_p2p_$_1_3.
public String ac_p2p_$_1_3(Args args) throws CacheException, InterruptedException, NoRouteToCellException {
if (args.argc() >= 3) {
String source = args.argv(1);
String dest = args.argv(2);
PnfsId pnfsId = new PnfsId(args.argv(0));
Pool2PoolTransferMsg p2p = new Pool2PoolTransferMsg(source, dest, FileAttributes.ofPnfsId(pnfsId));
cellEndPoint.sendMessage(new CellMessage(new CellPath(dest), p2p));
return "P2p of " + pnfsId + " initiated from " + source + " to " + dest;
} else {
PnfsId pnfsId = new PnfsId(args.argv(0));
String ip = args.getOpt("ip");
PnfsGetFileAttributes fileAttributesMsg = new PnfsGetFileAttributes(pnfsId, PoolMgrReplicateFileMsg.getRequiredAttributes());
fileAttributesMsg = _pnfsManager.sendAndWait(fileAttributesMsg);
DCapProtocolInfo pinfo = new DCapProtocolInfo("DCap", 0, 0, new InetSocketAddress("localhost", 0));
String timeoutString = args.getOpt("timeout");
long timeout = timeoutString != null ? Long.parseLong(timeoutString) * 1000L : 60000L;
PoolMgrReplicateFileMsg select = new PoolMgrReplicateFileMsg(fileAttributesMsg.getFileAttributes(), pinfo);
select = _poolManager.sendAndWait(select, timeout);
return "p2p -> " + select.getPool().getName();
}
}
use of diskCacheV111.vehicles.DCapProtocolInfo in project dcache by dCache.
the class HsmRestoreTest method setUp.
@Before
public void setUp() throws Exception {
_counter = _counter + 1;
_cell = new MockCellEndpoint("HsmRestoreTest" + _counter);
_protocolInfo = new DCapProtocolInfo("DCap", 3, 0, new InetSocketAddress("127.0.0.1", 17));
_storageInfo = new OSMStorageInfo("h1", "rawd");
_partitionManager = new PartitionManager();
PoolSelectionUnitV2 psu = new PoolSelectionUnitV2();
_access = psu;
_selectionUnit = psu;
_costModule = new CostModuleV1();
_pnfsHandler = new PnfsHandler(new CellPath("PnfsManager"));
_pnfsHandler.setCellEndpoint(_cell);
_poolMonitor = new PoolMonitorV5();
_poolMonitor.setPoolSelectionUnit(_selectionUnit);
_poolMonitor.setCostModule(_costModule);
_poolMonitor.setPartitionManager(_partitionManager);
/*
* allow stage
*/
_partitionManager.setProperties(null, ImmutableMap.of("stage-allowed", "yes"));
_rc = new RequestContainerV5(RETRY_INTERVAL);
_rc.setPoolSelectionUnit(_selectionUnit);
_rc.setPnfsHandler(_pnfsHandler);
_rc.setPoolMonitor(_poolMonitor);
_rc.setPartitionManager(_partitionManager);
_rc.setExecutor(MoreExecutors.directExecutor());
_rc.setCellEndpoint(_cell);
_rc.ac_rc_set_retry_$_1(new Args("0"));
_rc.setStageConfigurationFile(null);
_rc.setPnfsHandler(_pnfsHandler);
_rc.start();
__messages = new ArrayList<>();
}
use of diskCacheV111.vehicles.DCapProtocolInfo in project dcache by dCache.
the class DirectoryLookUpPool method messageArrived.
// //////////////////////////////////////////////////////////////
//
// The io File Part
//
//
public DirRequestMessage messageArrived(DirRequestMessage message) {
DCapProtocolInfo dcap = (DCapProtocolInfo) message.getProtocolInfo();
PnfsId pnfsId = message.getPnfsId();
Restriction restriction = message.getRestriction();
Subject subject = message.getSubject();
DirectoryService service = new DirectoryService(subject, restriction, dcap, pnfsId);
new Thread(service, "list[" + pnfsId + "]").start();
message.setSucceeded();
return message;
}
Aggregations