# IGNITE-226: WIP.
Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/141f8282 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/141f8282 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/141f8282 Branch: refs/heads/ignite-226 Commit: 141f82824c1d04b909c22beea87672b2c8747e8a Parents: 7848855 Author: vozerov-gridgain <voze...@gridgain.com> Authored: Fri Feb 13 14:31:47 2015 +0300 Committer: vozerov-gridgain <voze...@gridgain.com> Committed: Fri Feb 13 14:31:50 2015 +0300 ---------------------------------------------------------------------- .../ignitefs/CacheIgfsEvictionFilter.java | 2 +- .../CacheIgfsPerBlockLruEvictionPolicy.java | 2 +- .../igfs/IgfsGroupDataBlocksKeyMapper.java | 2 +- .../apache/ignite/igfs/mapreduce/IgfsTask.java | 2 +- .../ignite/internal/GridKernalContext.java | 2 +- .../ignite/internal/GridKernalContextImpl.java | 2 +- .../igfs/common/IgfsControlResponse.java | 2 +- .../communication/GridIoMessageFactory.java | 2 +- .../internal/processors/fs/IgfsAckMessage.java | 208 -- .../internal/processors/fs/IgfsAsyncImpl.java | 316 -- .../internal/processors/fs/IgfsAttributes.java | 186 -- .../internal/processors/fs/IgfsBlockKey.java | 274 -- .../processors/fs/IgfsBlockLocationImpl.java | 258 -- .../processors/fs/IgfsBlocksMessage.java | 188 -- .../processors/fs/IgfsClientSession.java | 75 - .../processors/fs/IgfsCommunicationMessage.java | 75 - .../internal/processors/fs/IgfsContext.java | 205 -- .../internal/processors/fs/IgfsDataManager.java | 1906 ----------- .../processors/fs/IgfsDeleteMessage.java | 202 -- .../processors/fs/IgfsDeleteWorker.java | 345 -- .../fs/IgfsDirectoryNotEmptyException.java | 44 - .../ignite/internal/processors/fs/IgfsEx.java | 143 - .../processors/fs/IgfsFileAffinityRange.java | 394 --- .../internal/processors/fs/IgfsFileImpl.java | 245 -- .../internal/processors/fs/IgfsFileInfo.java | 569 ---- .../internal/processors/fs/IgfsFileMap.java | 361 --- .../internal/processors/fs/IgfsFileWorker.java | 182 -- .../processors/fs/IgfsFileWorkerBatch.java | 236 -- .../processors/fs/IgfsFileWorkerTask.java | 32 - .../processors/fs/IgfsFragmentizerManager.java | 831 ----- .../processors/fs/IgfsFragmentizerRequest.java | 168 - .../processors/fs/IgfsFragmentizerResponse.java | 129 - .../processors/fs/IgfsHandshakeResponse.java | 122 - .../internal/processors/fs/IgfsHelper.java | 49 - .../internal/processors/fs/IgfsHelperImpl.java | 54 - .../ignite/internal/processors/fs/IgfsImpl.java | 2224 ------------- .../processors/fs/IgfsInputStreamAdapter.java | 49 - .../fs/IgfsInputStreamDescriptor.java | 78 - .../processors/fs/IgfsInputStreamImpl.java | 533 --- .../fs/IgfsInvalidRangeException.java | 43 - .../internal/processors/fs/IgfsIpcHandler.java | 562 ---- .../internal/processors/fs/IgfsJobImpl.java | 117 - .../processors/fs/IgfsListingEntry.java | 197 -- .../processors/fs/IgfsLocalMetrics.java | 212 -- .../internal/processors/fs/IgfsManager.java | 155 - .../internal/processors/fs/IgfsMetaManager.java | 3027 ------------------ .../processors/fs/IgfsMetricsAdapter.java | 239 -- .../processors/fs/IgfsModeResolver.java | 177 - .../internal/processors/fs/IgfsNoopHelper.java | 41 - .../processors/fs/IgfsNoopProcessor.java | 71 - .../processors/fs/IgfsOutputStreamAdapter.java | 263 -- .../processors/fs/IgfsOutputStreamImpl.java | 505 --- .../internal/processors/fs/IgfsPaths.java | 124 - .../internal/processors/fs/IgfsProcessor.java | 420 --- .../processors/fs/IgfsProcessorAdapter.java | 80 - .../internal/processors/fs/IgfsSamplingKey.java | 83 - .../fs/IgfsSecondaryInputStreamDescriptor.java | 59 - .../fs/IgfsSecondaryOutputStreamDescriptor.java | 74 - .../internal/processors/fs/IgfsServer.java | 427 --- .../processors/fs/IgfsServerHandler.java | 57 - .../processors/fs/IgfsServerManager.java | 211 -- .../internal/processors/fs/IgfsStatus.java | 76 - .../internal/processors/fs/IgfsSyncMessage.java | 161 - .../processors/fs/IgfsTaskArgsImpl.java | 135 - .../internal/processors/fs/IgfsThread.java | 82 - .../ignite/internal/processors/fs/package.html | 24 - .../processors/igfs/IgfsAckMessage.java | 208 ++ .../internal/processors/igfs/IgfsAsyncImpl.java | 316 ++ .../processors/igfs/IgfsAttributes.java | 186 ++ .../internal/processors/igfs/IgfsBlockKey.java | 274 ++ .../processors/igfs/IgfsBlockLocationImpl.java | 258 ++ .../processors/igfs/IgfsBlocksMessage.java | 188 ++ .../processors/igfs/IgfsClientSession.java | 75 + .../igfs/IgfsCommunicationMessage.java | 75 + .../internal/processors/igfs/IgfsContext.java | 205 ++ .../processors/igfs/IgfsDataManager.java | 1906 +++++++++++ .../processors/igfs/IgfsDeleteMessage.java | 202 ++ .../processors/igfs/IgfsDeleteWorker.java | 345 ++ .../igfs/IgfsDirectoryNotEmptyException.java | 44 + .../ignite/internal/processors/igfs/IgfsEx.java | 143 + .../processors/igfs/IgfsFileAffinityRange.java | 394 +++ .../internal/processors/igfs/IgfsFileImpl.java | 245 ++ .../internal/processors/igfs/IgfsFileInfo.java | 569 ++++ .../internal/processors/igfs/IgfsFileMap.java | 361 +++ .../processors/igfs/IgfsFileWorker.java | 182 ++ .../processors/igfs/IgfsFileWorkerBatch.java | 236 ++ .../processors/igfs/IgfsFileWorkerTask.java | 32 + .../igfs/IgfsFragmentizerManager.java | 831 +++++ .../igfs/IgfsFragmentizerRequest.java | 168 + .../igfs/IgfsFragmentizerResponse.java | 129 + .../processors/igfs/IgfsHandshakeResponse.java | 122 + .../internal/processors/igfs/IgfsHelper.java | 49 + .../processors/igfs/IgfsHelperImpl.java | 54 + .../internal/processors/igfs/IgfsImpl.java | 2224 +++++++++++++ .../processors/igfs/IgfsInputStreamAdapter.java | 49 + .../igfs/IgfsInputStreamDescriptor.java | 78 + .../processors/igfs/IgfsInputStreamImpl.java | 533 +++ .../igfs/IgfsInvalidRangeException.java | 43 + .../processors/igfs/IgfsIpcHandler.java | 562 ++++ .../internal/processors/igfs/IgfsJobImpl.java | 117 + .../processors/igfs/IgfsListingEntry.java | 197 ++ .../processors/igfs/IgfsLocalMetrics.java | 212 ++ .../internal/processors/igfs/IgfsManager.java | 155 + .../processors/igfs/IgfsMetaManager.java | 3027 ++++++++++++++++++ .../processors/igfs/IgfsMetricsAdapter.java | 239 ++ .../processors/igfs/IgfsModeResolver.java | 177 + .../processors/igfs/IgfsNoopHelper.java | 41 + .../processors/igfs/IgfsNoopProcessor.java | 71 + .../igfs/IgfsOutputStreamAdapter.java | 263 ++ .../processors/igfs/IgfsOutputStreamImpl.java | 505 +++ .../internal/processors/igfs/IgfsPaths.java | 124 + .../internal/processors/igfs/IgfsProcessor.java | 420 +++ .../processors/igfs/IgfsProcessorAdapter.java | 80 + .../processors/igfs/IgfsSamplingKey.java | 83 + .../IgfsSecondaryInputStreamDescriptor.java | 59 + .../IgfsSecondaryOutputStreamDescriptor.java | 74 + .../internal/processors/igfs/IgfsServer.java | 427 +++ .../processors/igfs/IgfsServerHandler.java | 57 + .../processors/igfs/IgfsServerManager.java | 211 ++ .../internal/processors/igfs/IgfsStatus.java | 76 + .../processors/igfs/IgfsSyncMessage.java | 161 + .../processors/igfs/IgfsTaskArgsImpl.java | 135 + .../internal/processors/igfs/IgfsThread.java | 82 + .../internal/processors/igfs/package.html | 24 + .../visor/ggfs/VisorIgfsSamplingStateTask.java | 2 +- .../visor/node/VisorNodeDataCollectorJob.java | 2 +- .../internal/visor/util/VisorTaskUtils.java | 2 +- .../ignite/igfs/IgfsEventsAbstractSelfTest.java | 2 +- .../igfs/IgfsFragmentizerAbstractSelfTest.java | 2 +- .../ignite/igfs/IgfsFragmentizerSelfTest.java | 2 +- ...heIgfsPerBlockLruEvictionPolicySelfTest.java | 485 --- .../processors/fs/IgfsAbstractSelfTest.java | 2453 -------------- .../processors/fs/IgfsAttributesSelfTest.java | 75 - .../processors/fs/IgfsCacheSelfTest.java | 133 - .../processors/fs/IgfsCommonAbstractTest.java | 67 - .../processors/fs/IgfsDataManagerSelfTest.java | 600 ---- .../processors/fs/IgfsDualAbstractSelfTest.java | 1601 --------- .../processors/fs/IgfsDualAsyncSelfTest.java | 32 - .../processors/fs/IgfsDualSyncSelfTest.java | 32 - .../processors/fs/IgfsFileInfoSelfTest.java | 88 - .../processors/fs/IgfsFileMapSelfTest.java | 337 -- ...IgfsGroupDataBlockKeyMapperHashSelfTest.java | 136 - .../processors/fs/IgfsMetaManagerSelfTest.java | 475 --- .../processors/fs/IgfsMetricsSelfTest.java | 536 ---- .../processors/fs/IgfsModeResolverSelfTest.java | 77 - .../processors/fs/IgfsModesSelfTest.java | 604 ---- .../fs/IgfsPrimaryOffheapTieredSelfTest.java | 33 - .../fs/IgfsPrimaryOffheapValuesSelfTest.java | 33 - .../processors/fs/IgfsPrimarySelfTest.java | 32 - .../processors/fs/IgfsProcessorSelfTest.java | 978 ------ .../fs/IgfsProcessorValidationSelfTest.java | 535 ---- ...IpcEndpointRegistrationAbstractSelfTest.java | 185 -- ...dpointRegistrationOnLinuxAndMacSelfTest.java | 50 - ...pcEndpointRegistrationOnWindowsSelfTest.java | 53 - .../processors/fs/IgfsSizeSelfTest.java | 875 ----- .../processors/fs/IgfsStreamsSelfTest.java | 472 --- .../processors/fs/IgfsTaskSelfTest.java | 311 -- .../processors/fs/IgfsTestInputStream.java | 66 - .../ignite/internal/processors/fs/package.html | 24 - .../IgfsAbstractRecordResolverSelfTest.java | 186 -- ...IgfsByteDelimiterRecordResolverSelfTest.java | 335 -- .../IgfsFixedLengthRecordResolverSelfTest.java | 147 - ...sNewLineDelimiterRecordResolverSelfTest.java | 129 - ...fsStringDelimiterRecordResolverSelfTest.java | 137 - ...heIgfsPerBlockLruEvictionPolicySelfTest.java | 485 +++ .../processors/igfs/IgfsAbstractSelfTest.java | 2453 ++++++++++++++ .../processors/igfs/IgfsAttributesSelfTest.java | 75 + .../processors/igfs/IgfsCacheSelfTest.java | 133 + .../processors/igfs/IgfsCommonAbstractTest.java | 67 + .../igfs/IgfsDataManagerSelfTest.java | 600 ++++ .../igfs/IgfsDualAbstractSelfTest.java | 1601 +++++++++ .../processors/igfs/IgfsDualAsyncSelfTest.java | 32 + .../processors/igfs/IgfsDualSyncSelfTest.java | 32 + .../processors/igfs/IgfsFileInfoSelfTest.java | 88 + .../processors/igfs/IgfsFileMapSelfTest.java | 337 ++ ...IgfsGroupDataBlockKeyMapperHashSelfTest.java | 136 + .../igfs/IgfsMetaManagerSelfTest.java | 475 +++ .../processors/igfs/IgfsMetricsSelfTest.java | 536 ++++ .../igfs/IgfsModeResolverSelfTest.java | 77 + .../processors/igfs/IgfsModesSelfTest.java | 604 ++++ .../igfs/IgfsPrimaryOffheapTieredSelfTest.java | 33 + .../igfs/IgfsPrimaryOffheapValuesSelfTest.java | 33 + .../processors/igfs/IgfsPrimarySelfTest.java | 32 + .../processors/igfs/IgfsProcessorSelfTest.java | 978 ++++++ .../igfs/IgfsProcessorValidationSelfTest.java | 535 ++++ ...IpcEndpointRegistrationAbstractSelfTest.java | 185 ++ ...dpointRegistrationOnLinuxAndMacSelfTest.java | 50 + ...pcEndpointRegistrationOnWindowsSelfTest.java | 53 + .../processors/igfs/IgfsSizeSelfTest.java | 875 +++++ .../processors/igfs/IgfsStreamsSelfTest.java | 472 +++ .../processors/igfs/IgfsTaskSelfTest.java | 311 ++ .../processors/igfs/IgfsTestInputStream.java | 66 + .../internal/processors/igfs/package.html | 24 + .../IgfsAbstractRecordResolverSelfTest.java | 186 ++ ...IgfsByteDelimiterRecordResolverSelfTest.java | 335 ++ .../IgfsFixedLengthRecordResolverSelfTest.java | 147 + ...sNewLineDelimiterRecordResolverSelfTest.java | 129 + ...fsStringDelimiterRecordResolverSelfTest.java | 137 + .../IpcServerEndpointDeserializerSelfTest.java | 2 +- .../ignite/testsuites/IgniteIgfsTestSuite.java | 4 +- .../igfs/hadoop/v1/IgfsHadoopFileSystem.java | 2 +- .../igfs/hadoop/v2/IgfsHadoopFileSystem.java | 2 +- .../ignite/internal/igfs/hadoop/IgfsHadoop.java | 2 +- .../hadoop/IgfsHadoopFileSystemWrapper.java | 2 +- .../internal/igfs/hadoop/IgfsHadoopInProc.java | 2 +- .../internal/igfs/hadoop/IgfsHadoopOutProc.java | 2 +- .../internal/igfs/hadoop/IgfsHadoopUtils.java | 2 +- .../internal/igfs/hadoop/IgfsHadoopWrapper.java | 2 +- .../GridHadoopDefaultMapReducePlanner.java | 2 +- .../IgfsHadoop20FileSystemAbstractSelfTest.java | 2 +- .../igfs/IgfsHadoopDualAbstractSelfTest.java | 4 +- .../IgfsHadoopFileSystemAbstractSelfTest.java | 2 +- .../IgfsHadoopFileSystemClientSelfTest.java | 2 +- .../IgfsHadoopFileSystemHandshakeSelfTest.java | 2 +- .../IgfsHadoopFileSystemIpcCacheSelfTest.java | 2 +- .../IgfsHadoopFileSystemLoggerSelfTest.java | 2 +- ...IgfsHadoopFileSystemLoggerStateSelfTest.java | 2 +- ...fsHadoopFileSystemSecondaryModeSelfTest.java | 2 +- .../hadoop/GridHadoopAbstractWordCountTest.java | 2 +- .../hadoop/GridHadoopCommandLineTest.java | 2 +- ...idHadoopDefaultMapReducePlannerSelfTest.java | 2 +- 221 files changed, 30654 insertions(+), 30654 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsEvictionFilter.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsEvictionFilter.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsEvictionFilter.java index f4b2a81..a6da344 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsEvictionFilter.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsEvictionFilter.java @@ -18,7 +18,7 @@ package org.apache.ignite.cache.eviction.ignitefs; import org.apache.ignite.cache.eviction.*; -import org.apache.ignite.internal.processors.fs.*; +import org.apache.ignite.internal.processors.igfs.*; import javax.cache.*; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsPerBlockLruEvictionPolicy.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsPerBlockLruEvictionPolicy.java b/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsPerBlockLruEvictionPolicy.java index 2db4082..11b469b 100644 --- a/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsPerBlockLruEvictionPolicy.java +++ b/modules/core/src/main/java/org/apache/ignite/cache/eviction/ignitefs/CacheIgfsPerBlockLruEvictionPolicy.java @@ -21,7 +21,7 @@ import org.apache.ignite.*; import org.apache.ignite.cache.eviction.*; import org.apache.ignite.igfs.*; import org.apache.ignite.internal.processors.cache.*; -import org.apache.ignite.internal.processors.fs.*; +import org.apache.ignite.internal.processors.igfs.*; import org.jdk8.backport.*; import org.jdk8.backport.ConcurrentLinkedDeque8.*; import org.jetbrains.annotations.*; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/igfs/IgfsGroupDataBlocksKeyMapper.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsGroupDataBlocksKeyMapper.java b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsGroupDataBlocksKeyMapper.java index 39e4a38..45108bf 100644 --- a/modules/core/src/main/java/org/apache/ignite/igfs/IgfsGroupDataBlocksKeyMapper.java +++ b/modules/core/src/main/java/org/apache/ignite/igfs/IgfsGroupDataBlocksKeyMapper.java @@ -18,7 +18,7 @@ package org.apache.ignite.igfs; import org.apache.ignite.internal.processors.cache.*; -import org.apache.ignite.internal.processors.fs.*; +import org.apache.ignite.internal.processors.igfs.*; import org.apache.ignite.internal.util.typedef.internal.*; /** http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/igfs/mapreduce/IgfsTask.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/igfs/mapreduce/IgfsTask.java b/modules/core/src/main/java/org/apache/ignite/igfs/mapreduce/IgfsTask.java index 3e29f8f..bcfdf92 100644 --- a/modules/core/src/main/java/org/apache/ignite/igfs/mapreduce/IgfsTask.java +++ b/modules/core/src/main/java/org/apache/ignite/igfs/mapreduce/IgfsTask.java @@ -22,7 +22,7 @@ import org.apache.ignite.cluster.*; import org.apache.ignite.compute.*; import org.apache.ignite.igfs.*; import org.apache.ignite.internal.*; -import org.apache.ignite.internal.processors.fs.*; +import org.apache.ignite.internal.processors.igfs.*; import org.apache.ignite.internal.util.typedef.internal.*; import org.apache.ignite.resources.*; import org.jetbrains.annotations.*; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java index 6a23f00..2e0f378 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java @@ -39,7 +39,7 @@ import org.apache.ignite.internal.processors.continuous.*; import org.apache.ignite.internal.processors.dataload.*; import org.apache.ignite.internal.processors.datastructures.*; import org.apache.ignite.internal.processors.email.*; -import org.apache.ignite.internal.processors.fs.*; +import org.apache.ignite.internal.processors.igfs.*; import org.apache.ignite.internal.processors.hadoop.*; import org.apache.ignite.internal.processors.job.*; import org.apache.ignite.internal.processors.jobmetrics.*; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java index 3e3e7a8..699d10a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/GridKernalContextImpl.java @@ -42,7 +42,7 @@ import org.apache.ignite.internal.processors.continuous.*; import org.apache.ignite.internal.processors.dataload.*; import org.apache.ignite.internal.processors.datastructures.*; import org.apache.ignite.internal.processors.email.*; -import org.apache.ignite.internal.processors.fs.*; +import org.apache.ignite.internal.processors.igfs.*; import org.apache.ignite.internal.processors.hadoop.*; import org.apache.ignite.internal.processors.job.*; import org.apache.ignite.internal.processors.jobmetrics.*; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsControlResponse.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsControlResponse.java b/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsControlResponse.java index 6c23329..90c72e2 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsControlResponse.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/igfs/common/IgfsControlResponse.java @@ -19,7 +19,7 @@ package org.apache.ignite.internal.igfs.common; import org.apache.ignite.*; import org.apache.ignite.igfs.*; -import org.apache.ignite.internal.processors.fs.*; +import org.apache.ignite.internal.processors.igfs.*; import org.apache.ignite.internal.util.tostring.*; import org.apache.ignite.internal.util.typedef.*; import org.apache.ignite.internal.util.typedef.internal.*; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java index 17186b5..56abef5 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/managers/communication/GridIoMessageFactory.java @@ -33,7 +33,7 @@ import org.apache.ignite.internal.processors.cache.version.*; import org.apache.ignite.internal.processors.clock.*; import org.apache.ignite.internal.processors.continuous.*; import org.apache.ignite.internal.processors.dataload.*; -import org.apache.ignite.internal.processors.fs.*; +import org.apache.ignite.internal.processors.igfs.*; import org.apache.ignite.internal.processors.rest.handlers.task.*; import org.apache.ignite.internal.processors.streamer.*; import org.apache.ignite.internal.util.*; http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsAckMessage.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsAckMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsAckMessage.java deleted file mode 100644 index 1d2e6be..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsAckMessage.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.fs; - -import org.apache.ignite.*; -import org.apache.ignite.internal.*; -import org.apache.ignite.lang.*; -import org.apache.ignite.marshaller.*; -import org.apache.ignite.plugin.extensions.communication.*; -import org.jetbrains.annotations.*; - -import java.io.*; -import java.nio.*; - -/** - * Block write request acknowledgement message. - */ -public class IgfsAckMessage extends IgfsCommunicationMessage { - /** */ - private static final long serialVersionUID = 0L; - - /** File id. */ - private IgniteUuid fileId; - - /** Request ID to ack. */ - private long id; - - /** Write exception. */ - @GridDirectTransient - private IgniteCheckedException err; - - /** */ - private byte[] errBytes; - - /** - * Empty constructor required by {@link Externalizable}. - */ - public IgfsAckMessage() { - // No-op. - } - - /** - * @param fileId File ID. - * @param id Request ID. - * @param err Error. - */ - public IgfsAckMessage(IgniteUuid fileId, long id, @Nullable IgniteCheckedException err) { - this.fileId = fileId; - this.id = id; - this.err = err; - } - - /** - * @return File ID. - */ - public IgniteUuid fileId() { - return fileId; - } - - /** - * @return Batch ID. - */ - public long id() { - return id; - } - - /** - * @return Error occurred when writing this batch, if any. - */ - public IgniteCheckedException error() { - return err; - } - - /** {@inheritDoc} */ - @Override public void prepareMarshal(Marshaller marsh) throws IgniteCheckedException { - super.prepareMarshal(marsh); - - if (err != null) - errBytes = marsh.marshal(err); - } - - /** {@inheritDoc} */ - @Override public void finishUnmarshal(Marshaller marsh, @Nullable ClassLoader ldr) throws IgniteCheckedException { - super.finishUnmarshal(marsh, ldr); - - if (errBytes != null) - err = marsh.unmarshal(errBytes, ldr); - } - - /** {@inheritDoc} */ - @SuppressWarnings({"CloneDoesntCallSuperClone", "CloneCallsConstructors"}) - @Override public MessageAdapter clone() { - IgfsAckMessage _clone = new IgfsAckMessage(); - - clone0(_clone); - - return _clone; - } - - /** {@inheritDoc} */ - @Override protected void clone0(MessageAdapter _msg) { - super.clone0(_msg); - - IgfsAckMessage _clone = (IgfsAckMessage)_msg; - - _clone.fileId = fileId; - _clone.id = id; - _clone.err = err; - _clone.errBytes = errBytes; - } - - /** {@inheritDoc} */ - @SuppressWarnings("all") - @Override public boolean writeTo(ByteBuffer buf) { - writer.setBuffer(buf); - - if (!super.writeTo(buf)) - return false; - - if (!typeWritten) { - if (!writer.writeByte(null, directType())) - return false; - - typeWritten = true; - } - - switch (state) { - case 0: - if (!writer.writeByteArray("errBytes", errBytes)) - return false; - - state++; - - case 1: - if (!writer.writeIgniteUuid("fileId", fileId)) - return false; - - state++; - - case 2: - if (!writer.writeLong("id", id)) - return false; - - state++; - - } - - return true; - } - - /** {@inheritDoc} */ - @SuppressWarnings("all") - @Override public boolean readFrom(ByteBuffer buf) { - reader.setBuffer(buf); - - if (!super.readFrom(buf)) - return false; - - switch (state) { - case 0: - errBytes = reader.readByteArray("errBytes"); - - if (!reader.isLastRead()) - return false; - - state++; - - case 1: - fileId = reader.readIgniteUuid("fileId"); - - if (!reader.isLastRead()) - return false; - - state++; - - case 2: - id = reader.readLong("id"); - - if (!reader.isLastRead()) - return false; - - state++; - - } - - return true; - } - - /** {@inheritDoc} */ - @Override public byte directType() { - return 64; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsAsyncImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsAsyncImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsAsyncImpl.java deleted file mode 100644 index 6ec7a1f..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsAsyncImpl.java +++ /dev/null @@ -1,316 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.fs; - -import org.apache.ignite.*; -import org.apache.ignite.configuration.*; -import org.apache.ignite.igfs.*; -import org.apache.ignite.igfs.mapreduce.*; -import org.apache.ignite.internal.*; -import org.apache.ignite.internal.util.typedef.internal.*; -import org.apache.ignite.lang.*; -import org.jetbrains.annotations.*; - -import java.net.*; -import java.util.*; - -/** - * Ggfs supporting asynchronous operations. - */ -public class IgfsAsyncImpl extends AsyncSupportAdapter<IgniteFs> implements IgfsEx { - /** */ - private final IgfsImpl ggfs; - - /** - * @param ggfs Ggfs. - */ - public IgfsAsyncImpl(IgfsImpl ggfs) { - super(true); - - this.ggfs = ggfs; - } - - /** {@inheritDoc} */ - @Override public void format() { - try { - saveOrGet(ggfs.formatAsync()); - } - catch (IgniteCheckedException e) { - throw U.convertException(e); - } - } - - /** {@inheritDoc} */ - @Override public <T, R> R execute(IgfsTask<T, R> task, @Nullable IgfsRecordResolver rslvr, - Collection<IgfsPath> paths, @Nullable T arg) { - try { - return saveOrGet(ggfs.executeAsync(task, rslvr, paths, arg)); - } - catch (IgniteCheckedException e) { - throw U.convertException(e); - } - } - - /** {@inheritDoc} */ - @Override public <T, R> R execute(IgfsTask<T, R> task, @Nullable IgfsRecordResolver rslvr, - Collection<IgfsPath> paths, boolean skipNonExistentFiles, long maxRangeLen, @Nullable T arg) { - try { - return saveOrGet(ggfs.executeAsync(task, rslvr, paths, skipNonExistentFiles, maxRangeLen, arg)); - } - catch (IgniteCheckedException e) { - throw U.convertException(e); - } - } - - /** {@inheritDoc} */ - @Override public <T, R> R execute(Class<? extends IgfsTask<T, R>> taskCls, - @Nullable IgfsRecordResolver rslvr, Collection<IgfsPath> paths, @Nullable T arg) { - try { - return saveOrGet(ggfs.executeAsync(taskCls, rslvr, paths, arg)); - } - catch (IgniteCheckedException e) { - throw U.convertException(e); - } - } - - /** {@inheritDoc} */ - @Override public <T, R> R execute(Class<? extends IgfsTask<T, R>> taskCls, - @Nullable IgfsRecordResolver rslvr, Collection<IgfsPath> paths, boolean skipNonExistentFiles, - long maxRangeLen, @Nullable T arg) { - try { - return saveOrGet(ggfs.executeAsync(taskCls, rslvr, paths, skipNonExistentFiles, maxRangeLen, arg)); - } - catch (IgniteCheckedException e) { - throw U.convertException(e); - } - } - - /** {@inheritDoc} */ - @Override public void stop() { - ggfs.stop(); - } - - /** {@inheritDoc} */ - @Override public IgfsContext context() { - return ggfs.context(); - } - - /** {@inheritDoc} */ - @Override public IgfsPaths proxyPaths() { - return ggfs.proxyPaths(); - } - - /** {@inheritDoc} */ - @Override public IgfsInputStreamAdapter open(IgfsPath path, int bufSize, - int seqReadsBeforePrefetch) { - return ggfs.open(path, bufSize, seqReadsBeforePrefetch); - } - - /** {@inheritDoc} */ - @Override public IgfsInputStreamAdapter open(IgfsPath path) { - return ggfs.open(path); - } - - /** {@inheritDoc} */ - @Override public IgfsInputStreamAdapter open(IgfsPath path, int bufSize) { - return ggfs.open(path, bufSize); - } - - /** {@inheritDoc} */ - @Override public IgfsStatus globalSpace() throws IgniteCheckedException { - return ggfs.globalSpace(); - } - - /** {@inheritDoc} */ - @Override public void globalSampling(@Nullable Boolean val) throws IgniteCheckedException { - ggfs.globalSampling(val); - } - - /** {@inheritDoc} */ - @Nullable @Override public Boolean globalSampling() { - return ggfs.globalSampling(); - } - - /** {@inheritDoc} */ - @Override public IgfsLocalMetrics localMetrics() { - return ggfs.localMetrics(); - } - - /** {@inheritDoc} */ - @Override public long groupBlockSize() { - return ggfs.groupBlockSize(); - } - - /** {@inheritDoc} */ - @Override public IgniteInternalFuture<?> awaitDeletesAsync() throws IgniteCheckedException { - return ggfs.awaitDeletesAsync(); - } - - /** {@inheritDoc} */ - @Nullable @Override public String clientLogDirectory() { - return ggfs.clientLogDirectory(); - } - - /** {@inheritDoc} */ - @Override public void clientLogDirectory(String logDir) { - ggfs.clientLogDirectory(logDir); - } - - /** {@inheritDoc} */ - @Override public boolean evictExclude(IgfsPath path, boolean primary) { - return ggfs.evictExclude(path, primary); - } - - /** {@inheritDoc} */ - @Override public IgniteUuid nextAffinityKey() { - return ggfs.nextAffinityKey(); - } - - /** {@inheritDoc} */ - @Override public boolean isProxy(URI path) { - return ggfs.isProxy(path); - } - - /** {@inheritDoc} */ - @Nullable @Override public String name() { - return ggfs.name(); - } - - /** {@inheritDoc} */ - @Override public IgfsConfiguration configuration() { - return ggfs.configuration(); - } - - /** {@inheritDoc} */ - @Override public IgfsPathSummary summary(IgfsPath path) { - return ggfs.summary(path); - } - - /** {@inheritDoc} */ - @Override public IgfsOutputStream create(IgfsPath path, boolean overwrite) { - return ggfs.create(path, overwrite); - } - - /** {@inheritDoc} */ - @Override public IgfsOutputStream create(IgfsPath path, int bufSize, boolean overwrite, int replication, - long blockSize, @Nullable Map<String, String> props) { - return ggfs.create(path, bufSize, overwrite, replication, blockSize, props); - } - - /** {@inheritDoc} */ - @Override public IgfsOutputStream create(IgfsPath path, int bufSize, boolean overwrite, - @Nullable IgniteUuid affKey, int replication, long blockSize, @Nullable Map<String, String> props) { - return ggfs.create(path, bufSize, overwrite, affKey, replication, blockSize, props); - } - - /** {@inheritDoc} */ - @Override public IgfsOutputStream append(IgfsPath path, boolean create) { - return ggfs.append(path, create); - } - - /** {@inheritDoc} */ - @Override public IgfsOutputStream append(IgfsPath path, int bufSize, boolean create, - @Nullable Map<String, String> props) { - return ggfs.append(path, bufSize, create, props); - } - - /** {@inheritDoc} */ - @Override public void setTimes(IgfsPath path, long accessTime, long modificationTime) { - ggfs.setTimes(path, accessTime, modificationTime); - } - - /** {@inheritDoc} */ - @Override public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len) { - return ggfs.affinity(path, start, len); - } - - /** {@inheritDoc} */ - @Override public Collection<IgfsBlockLocation> affinity(IgfsPath path, long start, long len, long maxLen) { - return ggfs.affinity(path, start, len, maxLen); - } - - /** {@inheritDoc} */ - @Override public IgfsMetrics metrics() { - return ggfs.metrics(); - } - - /** {@inheritDoc} */ - @Override public void resetMetrics() { - ggfs.resetMetrics(); - } - - /** {@inheritDoc} */ - @Override public long size(IgfsPath path) { - return ggfs.size(path); - } - - /** {@inheritDoc} */ - @Override public boolean exists(IgfsPath path) { - return ggfs.exists(path); - } - - /** {@inheritDoc} */ - @Nullable @Override public IgfsFile update(IgfsPath path, Map<String, String> props) { - return ggfs.update(path, props); - } - - /** {@inheritDoc} */ - @Override public void rename(IgfsPath src, IgfsPath dest) { - ggfs.rename(src, dest); - } - - /** {@inheritDoc} */ - @Override public boolean delete(IgfsPath path, boolean recursive) { - return ggfs.delete(path, recursive); - } - - /** {@inheritDoc} */ - @Override public void mkdirs(IgfsPath path) { - ggfs.mkdirs(path); - } - - /** {@inheritDoc} */ - @Override public void mkdirs(IgfsPath path, @Nullable Map<String, String> props) { - ggfs.mkdirs(path, props); - } - - /** {@inheritDoc} */ - @Override public Collection<IgfsPath> listPaths(IgfsPath path) { - return ggfs.listPaths(path); - } - - /** {@inheritDoc} */ - @Override public Collection<IgfsFile> listFiles(IgfsPath path) { - return ggfs.listFiles(path); - } - - /** {@inheritDoc} */ - @Nullable @Override public IgfsFile info(IgfsPath path) { - return ggfs.info(path); - } - - /** {@inheritDoc} */ - @Override public long usedSpaceSize() { - return ggfs.usedSpaceSize(); - } - - /** {@inheritDoc} */ - @Override public Map<String, String> properties() { - return ggfs.properties(); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsAttributes.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsAttributes.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsAttributes.java deleted file mode 100644 index cb3a768..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsAttributes.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.fs; - -import org.apache.ignite.igfs.*; -import org.apache.ignite.internal.util.typedef.internal.*; - -import java.io.*; -import java.util.*; - -/** - * GGFS attributes. - * <p> - * This class contains information on a single GGFS configured on some node. - */ -public class IgfsAttributes implements Externalizable { - /** */ - private static final long serialVersionUID = 0L; - - /** GGFS name. */ - private String ggfsName; - - /** File's data block size (bytes). */ - private int blockSize; - - /** Size of the group figured in {@link org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper}. */ - private int grpSize; - - /** Meta cache name. */ - private String metaCacheName; - - /** Data cache name. */ - private String dataCacheName; - - /** Default mode. */ - private IgfsMode dfltMode; - - /** Fragmentizer enabled flag. */ - private boolean fragmentizerEnabled; - - /** Path modes. */ - private Map<String, IgfsMode> pathModes; - - /** - * @param ggfsName GGFS name. - * @param blockSize File's data block size (bytes). - * @param grpSize Size of the group figured in {@link org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper}. - * @param metaCacheName Meta cache name. - * @param dataCacheName Data cache name. - * @param dfltMode Default mode. - * @param pathModes Path modes. - */ - public IgfsAttributes(String ggfsName, int blockSize, int grpSize, String metaCacheName, String dataCacheName, - IgfsMode dfltMode, Map<String, IgfsMode> pathModes, boolean fragmentizerEnabled) { - this.blockSize = blockSize; - this.ggfsName = ggfsName; - this.grpSize = grpSize; - this.metaCacheName = metaCacheName; - this.dataCacheName = dataCacheName; - this.dfltMode = dfltMode; - this.pathModes = pathModes; - this.fragmentizerEnabled = fragmentizerEnabled; - } - - /** - * Public no-arg constructor for {@link Externalizable}. - */ - public IgfsAttributes() { - // No-op. - } - - /** - * @return GGFS name. - */ - public String ggfsName() { - return ggfsName; - } - - /** - * @return File's data block size (bytes). - */ - public int blockSize() { - return blockSize; - } - - /** - * @return Size of the group figured in {@link org.apache.ignite.igfs.IgfsGroupDataBlocksKeyMapper}. - */ - public int groupSize() { - return grpSize; - } - - /** - * @return Metadata cache name. - */ - public String metaCacheName() { - return metaCacheName; - } - - /** - * @return Data cache name. - */ - public String dataCacheName() { - return dataCacheName; - } - - /** - * @return Default mode. - */ - public IgfsMode defaultMode() { - return dfltMode; - } - - /** - * @return Path modes. - */ - public Map<String, IgfsMode> pathModes() { - return pathModes != null ? Collections.unmodifiableMap(pathModes) : null; - } - - /** - * @return {@code True} if fragmentizer is enabled. - */ - public boolean fragmentizerEnabled() { - return fragmentizerEnabled; - } - - /** {@inheritDoc} */ - @Override public void writeExternal(ObjectOutput out) throws IOException { - U.writeString(out, ggfsName); - out.writeInt(blockSize); - out.writeInt(grpSize); - U.writeString(out, metaCacheName); - U.writeString(out, dataCacheName); - U.writeEnum(out, dfltMode); - out.writeBoolean(fragmentizerEnabled); - - if (pathModes != null) { - out.writeBoolean(true); - - out.writeInt(pathModes.size()); - - for (Map.Entry<String, IgfsMode> pathMode : pathModes.entrySet()) { - U.writeString(out, pathMode.getKey()); - U.writeEnum(out, pathMode.getValue()); - } - } - else - out.writeBoolean(false); - } - - /** {@inheritDoc} */ - @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { - ggfsName = U.readString(in); - blockSize = in.readInt(); - grpSize = in.readInt(); - metaCacheName = U.readString(in); - dataCacheName = U.readString(in); - dfltMode = IgfsMode.fromOrdinal(in.readByte()); - fragmentizerEnabled = in.readBoolean(); - - if (in.readBoolean()) { - int size = in.readInt(); - - pathModes = new HashMap<>(size, 1.0f); - - for (int i = 0; i < size; i++) - pathModes.put(U.readString(in), IgfsMode.fromOrdinal(in.readByte())); - } - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsBlockKey.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsBlockKey.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsBlockKey.java deleted file mode 100644 index 81f0a36..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsBlockKey.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.fs; - -import org.apache.ignite.internal.processors.task.*; -import org.apache.ignite.internal.util.typedef.*; -import org.apache.ignite.internal.util.typedef.internal.*; -import org.apache.ignite.lang.*; -import org.apache.ignite.plugin.extensions.communication.*; -import org.jetbrains.annotations.*; - -import java.io.*; -import java.nio.*; - -/** - * File's binary data block key. - */ -@GridInternal -public final class IgfsBlockKey extends MessageAdapter implements Externalizable, Comparable<IgfsBlockKey> { - /** */ - private static final long serialVersionUID = 0L; - - /** File system file ID. */ - private IgniteUuid fileId; - - /** Block ID. */ - private long blockId; - - /** Block affinity key. */ - private IgniteUuid affKey; - - /** Eviction exclude flag. */ - private boolean evictExclude; - - /** - * Constructs file's binary data block key. - * - * @param fileId File ID. - * @param affKey Affinity key. - * @param evictExclude Evict exclude flag. - * @param blockId Block ID. - */ - public IgfsBlockKey(IgniteUuid fileId, @Nullable IgniteUuid affKey, boolean evictExclude, long blockId) { - assert fileId != null; - assert blockId >= 0; - - this.fileId = fileId; - this.affKey = affKey; - this.evictExclude = evictExclude; - this.blockId = blockId; - } - - /** - * Empty constructor required for {@link Externalizable}. - */ - public IgfsBlockKey() { - // No-op. - } - - /** - * @return File ID. - */ - public IgniteUuid getFileId() { - return fileId; - } - - /** - * @return Block affinity key. - */ - public IgniteUuid affinityKey() { - return affKey; - } - - /** - * @return Evict exclude flag. - */ - public boolean evictExclude() { - return evictExclude; - } - - /** - * @return Block ID. - */ - public long getBlockId() { - return blockId; - } - - /** {@inheritDoc} */ - @Override public int compareTo(@NotNull IgfsBlockKey o) { - int res = fileId.compareTo(o.fileId); - - if (res != 0) - return res; - - long v1 = blockId; - long v2 = o.blockId; - - if (v1 != v2) - return v1 > v2 ? 1 : -1; - - if (affKey == null && o.affKey == null) - return 0; - - if (affKey != null && o.affKey != null) - return affKey.compareTo(o.affKey); - - return affKey != null ? -1 : 1; - } - - /** {@inheritDoc} */ - @Override public void writeExternal(ObjectOutput out) throws IOException { - U.writeGridUuid(out, fileId); - U.writeGridUuid(out, affKey); - out.writeBoolean(evictExclude); - out.writeLong(blockId); - } - - /** {@inheritDoc} */ - @Override public void readExternal(ObjectInput in) throws IOException { - fileId = U.readGridUuid(in); - affKey = U.readGridUuid(in); - evictExclude = in.readBoolean(); - blockId = in.readLong(); - } - - /** {@inheritDoc} */ - @Override public int hashCode() { - return fileId.hashCode() + (int)(blockId ^ (blockId >>> 32)); - } - - /** {@inheritDoc} */ - @Override public boolean equals(Object o) { - if (o == this) - return true; - - if (o == null || o.getClass() != getClass()) - return false; - - IgfsBlockKey that = (IgfsBlockKey)o; - - return blockId == that.blockId && fileId.equals(that.fileId) && F.eq(affKey, that.affKey) && - evictExclude == that.evictExclude; - } - - /** {@inheritDoc} */ - @SuppressWarnings({"CloneDoesntCallSuperClone", "CloneCallsConstructors"}) - @Override public MessageAdapter clone() { - IgfsBlockKey _clone = new IgfsBlockKey(); - - clone0(_clone); - - return _clone; - } - - /** {@inheritDoc} */ - @Override protected void clone0(MessageAdapter _msg) { - IgfsBlockKey _clone = (IgfsBlockKey)_msg; - - _clone.fileId = fileId; - _clone.blockId = blockId; - _clone.affKey = affKey; - _clone.evictExclude = evictExclude; - } - - /** {@inheritDoc} */ - @SuppressWarnings("fallthrough") - @Override public boolean writeTo(ByteBuffer buf) { - writer.setBuffer(buf); - - if (!typeWritten) { - if (!writer.writeByte(null, directType())) - return false; - - typeWritten = true; - } - - switch (state) { - case 0: - if (!writer.writeIgniteUuid("affKey", affKey)) - return false; - - state++; - - case 1: - if (!writer.writeLong("blockId", blockId)) - return false; - - state++; - - case 2: - if (!writer.writeBoolean("evictExclude", evictExclude)) - return false; - - state++; - - case 3: - if (!writer.writeIgniteUuid("fileId", fileId)) - return false; - - state++; - - } - - return true; - } - - /** {@inheritDoc} */ - @SuppressWarnings("fallthrough") - @Override public boolean readFrom(ByteBuffer buf) { - reader.setBuffer(buf); - - switch (state) { - case 0: - affKey = reader.readIgniteUuid("affKey"); - - if (!reader.isLastRead()) - return false; - - state++; - - case 1: - blockId = reader.readLong("blockId"); - - if (!reader.isLastRead()) - return false; - - state++; - - case 2: - evictExclude = reader.readBoolean("evictExclude"); - - if (!reader.isLastRead()) - return false; - - state++; - - case 3: - fileId = reader.readIgniteUuid("fileId"); - - if (!reader.isLastRead()) - return false; - - state++; - - } - - return true; - } - - /** {@inheritDoc} */ - @Override public byte directType() { - return 65; - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(IgfsBlockKey.class, this); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsBlockLocationImpl.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsBlockLocationImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsBlockLocationImpl.java deleted file mode 100644 index 8830415..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsBlockLocationImpl.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.fs; - -import org.apache.ignite.*; -import org.apache.ignite.cluster.*; -import org.apache.ignite.igfs.*; -import org.apache.ignite.internal.util.tostring.*; -import org.apache.ignite.internal.util.typedef.*; -import org.apache.ignite.internal.util.typedef.internal.*; - -import java.io.*; -import java.net.*; -import java.util.*; - -/** - * File block location in the grid. - */ -public class IgfsBlockLocationImpl implements IgfsBlockLocation, Externalizable { - /** */ - private static final long serialVersionUID = 0L; - - /** */ - private long start; - - /** */ - private long len; - - /** */ - @GridToStringInclude - private Collection<UUID> nodeIds; - - /** */ - private Collection<String> names; - - /** */ - private Collection<String> hosts; - - /** - * Empty constructor for externalizable. - */ - public IgfsBlockLocationImpl() { - // No-op. - } - - /** - * @param location HDFS block location. - * @param len New length. - */ - public IgfsBlockLocationImpl(IgfsBlockLocation location, long len) { - assert location != null; - - start = location.start(); - this.len = len; - - nodeIds = location.nodeIds(); - names = location.names(); - hosts = location.hosts(); - } - - /** - * @param start Start. - * @param len Length. - * @param nodes Affinity nodes. - */ - public IgfsBlockLocationImpl(long start, long len, Collection<ClusterNode> nodes) { - assert start >= 0; - assert len > 0; - assert nodes != null && !nodes.isEmpty(); - - this.start = start; - this.len = len; - - convertFromNodes(nodes); - } - - /** - * @return Start position. - */ - @Override public long start() { - return start; - } - - /** - * @return Length. - */ - @Override public long length() { - return len; - } - - /** - * @return Node IDs. - */ - @Override public Collection<UUID> nodeIds() { - return nodeIds; - } - - /** {@inheritDoc} */ - @Override public Collection<String> names() { - return names; - } - - /** {@inheritDoc} */ - @Override public Collection<String> hosts() { - return hosts; - } - - /** {@inheritDoc} */ - @Override public int hashCode() { - int res = (int)(start ^ (start >>> 32)); - - res = 31 * res + (int)(len ^ (len >>> 32)); - res = 31 * res + nodeIds.hashCode(); - - return res; - } - - /** {@inheritDoc} */ - @Override public boolean equals(Object o) { - if (o == this) - return true; - - if (o == null || getClass() != o.getClass()) - return false; - - IgfsBlockLocationImpl that = (IgfsBlockLocationImpl)o; - - return len == that.len && start == that.start && F.eq(nodeIds, that.nodeIds) && F.eq(names, that.names) && - F.eq(hosts, that.hosts); - } - - /** {@inheritDoc} */ - @Override public String toString() { - return S.toString(IgfsBlockLocationImpl.class, this); - } - - /** - * Writes this object to data output. Note that this is not externalizable - * interface because we want to eliminate any marshaller. - * - * @param out Data output to write. - * @throws IOException If write failed. - */ - @Override public void writeExternal(ObjectOutput out) throws IOException { - assert names != null; - assert hosts != null; - - out.writeLong(start); - out.writeLong(len); - - out.writeBoolean(nodeIds != null); - - if (nodeIds != null) { - out.writeInt(nodeIds.size()); - - for (UUID nodeId : nodeIds) - U.writeUuid(out, nodeId); - } - - out.writeInt(names.size()); - - for (String name : names) - out.writeUTF(name); - - out.writeInt(hosts.size()); - - for (String host : hosts) - out.writeUTF(host); - } - - /** - * Reads object from data input. Note we do not use externalizable interface - * to eliminate marshaller. - * - * @param in Data input. - * @throws IOException If read failed. - */ - @Override public void readExternal(ObjectInput in) throws IOException { - start = in.readLong(); - len = in.readLong(); - - int size; - - if (in.readBoolean()) { - size = in.readInt(); - - nodeIds = new ArrayList<>(size); - - for (int i = 0; i < size; i++) - nodeIds.add(U.readUuid(in)); - } - - size = in.readInt(); - - names = new ArrayList<>(size); - - for (int i = 0; i < size; i++) - names.add(in.readUTF()); - - size = in.readInt(); - - hosts = new ArrayList<>(size); - - for (int i = 0; i < size; i++) - hosts.add(in.readUTF()); - } - - /** - * Converts collection of rich nodes to block location data. - * - * @param nodes Collection of affinity nodes. - */ - private void convertFromNodes(Collection<ClusterNode> nodes) { - Collection<String> names = new LinkedHashSet<>(); - Collection<String> hosts = new LinkedHashSet<>(); - Collection<UUID> nodeIds = new ArrayList<>(nodes.size()); - - for (final ClusterNode node : nodes) { - // Normalize host names into Hadoop-expected format. - try { - Collection<InetAddress> addrs = U.toInetAddresses(node); - - for (InetAddress addr : addrs) { - if (addr.getHostName() == null) - names.add(addr.getHostAddress() + ":" + 9001); - else { - names.add(addr.getHostName() + ":" + 9001); // hostname:portNumber - hosts.add(addr.getHostName()); - } - } - } - catch (IgniteCheckedException ignored) { - names.addAll(node.addresses()); - } - - nodeIds.add(node.id()); - } - - this.nodeIds = nodeIds; - this.names = names; - this.hosts = hosts; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsBlocksMessage.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsBlocksMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsBlocksMessage.java deleted file mode 100644 index 95a9430..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsBlocksMessage.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.fs; - -import org.apache.ignite.internal.*; -import org.apache.ignite.lang.*; -import org.apache.ignite.plugin.extensions.communication.*; - -import java.io.*; -import java.nio.*; -import java.util.*; - -/** - * GGFS write blocks message. - */ -public class IgfsBlocksMessage extends IgfsCommunicationMessage { - /** */ - private static final long serialVersionUID = 0L; - - /** File id. */ - private IgniteUuid fileId; - - /** Batch id */ - private long id; - - /** Blocks to store. */ - @GridDirectMap(keyType = IgfsBlockKey.class, valueType = byte[].class) - private Map<IgfsBlockKey, byte[]> blocks; - - /** - * Empty constructor required by {@link Externalizable} - */ - public IgfsBlocksMessage() { - // No-op. - } - - /** - * Constructor. - * - * @param fileId File ID. - * @param id Message id. - * @param blocks Blocks to put in cache. - */ - public IgfsBlocksMessage(IgniteUuid fileId, long id, Map<IgfsBlockKey, byte[]> blocks) { - this.fileId = fileId; - this.id = id; - this.blocks = blocks; - } - - /** - * @return File id. - */ - public IgniteUuid fileId() { - return fileId; - } - - /** - * @return Batch id. - */ - public long id() { - return id; - } - - /** - * @return Map of blocks to put in cache. - */ - public Map<IgfsBlockKey, byte[]> blocks() { - return blocks; - } - - /** {@inheritDoc} */ - @SuppressWarnings({"CloneDoesntCallSuperClone", "CloneCallsConstructors"}) - @Override public MessageAdapter clone() { - IgfsBlocksMessage _clone = new IgfsBlocksMessage(); - - clone0(_clone); - - return _clone; - } - - /** {@inheritDoc} */ - @Override protected void clone0(MessageAdapter _msg) { - super.clone0(_msg); - - IgfsBlocksMessage _clone = (IgfsBlocksMessage)_msg; - - _clone.fileId = fileId; - _clone.id = id; - _clone.blocks = blocks; - } - - /** {@inheritDoc} */ - @SuppressWarnings("all") - @Override public boolean writeTo(ByteBuffer buf) { - writer.setBuffer(buf); - - if (!super.writeTo(buf)) - return false; - - if (!typeWritten) { - if (!writer.writeByte(null, directType())) - return false; - - typeWritten = true; - } - - switch (state) { - case 0: - if (!writer.writeMap("blocks", blocks, IgfsBlockKey.class, byte[].class)) - return false; - - state++; - - case 1: - if (!writer.writeIgniteUuid("fileId", fileId)) - return false; - - state++; - - case 2: - if (!writer.writeLong("id", id)) - return false; - - state++; - - } - - return true; - } - - /** {@inheritDoc} */ - @SuppressWarnings("all") - @Override public boolean readFrom(ByteBuffer buf) { - reader.setBuffer(buf); - - if (!super.readFrom(buf)) - return false; - - switch (state) { - case 0: - blocks = reader.readMap("blocks", IgfsBlockKey.class, byte[].class, false); - - if (!reader.isLastRead()) - return false; - - state++; - - case 1: - fileId = reader.readIgniteUuid("fileId"); - - if (!reader.isLastRead()) - return false; - - state++; - - case 2: - id = reader.readLong("id"); - - if (!reader.isLastRead()) - return false; - - state++; - - } - - return true; - } - - /** {@inheritDoc} */ - @Override public byte directType() { - return 66; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsClientSession.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsClientSession.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsClientSession.java deleted file mode 100644 index 09b09bc..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsClientSession.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.fs; - -import org.jdk8.backport.*; -import org.jetbrains.annotations.*; - -import java.io.*; -import java.util.*; -import java.util.concurrent.*; - -/** - * GGFS client session. Effectively used to manage lifecycle of opened resources and close them on - * connection close. - */ -public class IgfsClientSession { - /** Session resources. */ - private ConcurrentMap<Long, Closeable> rsrcMap = new ConcurrentHashMap8<>(); - - /** - * Registers resource within this session. - * - * @param rsrcId Resource id. - * @param rsrc Resource to register. - */ - public boolean registerResource(long rsrcId, Closeable rsrc) { - Object old = rsrcMap.putIfAbsent(rsrcId, rsrc); - - return old == null; - } - - /** - * Gets registered resource by ID. - * - * @param rsrcId Resource ID. - * @return Resource or {@code null} if resource was not found. - */ - @Nullable public <T> T resource(Long rsrcId) { - return (T)rsrcMap.get(rsrcId); - } - - /** - * Unregister previously registered resource. - * - * @param rsrcId Resource ID. - * @param rsrc Resource to unregister. - * @return {@code True} if resource was unregistered, {@code false} if no resource - * is associated with this ID or other resource is associated with this ID. - */ - public boolean unregisterResource(Long rsrcId, Closeable rsrc) { - return rsrcMap.remove(rsrcId, rsrc); - } - - /** - * @return Registered resources iterator. - */ - public Iterator<Closeable> registeredResources() { - return rsrcMap.values().iterator(); - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsCommunicationMessage.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsCommunicationMessage.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsCommunicationMessage.java deleted file mode 100644 index ddf0569..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsCommunicationMessage.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.fs; - -import org.apache.ignite.*; -import org.apache.ignite.marshaller.*; -import org.apache.ignite.plugin.extensions.communication.*; -import org.jetbrains.annotations.*; - -import java.nio.*; - -/** - * Base class for all GGFS communication messages sent between nodes. - */ -public abstract class IgfsCommunicationMessage extends MessageAdapter { - /** */ - private static final long serialVersionUID = 0L; - - /** {@inheritDoc} */ - @Override protected void clone0(MessageAdapter _msg) { - } - - /** - * @param marsh Marshaller. - * @throws IgniteCheckedException In case of error. - */ - public void prepareMarshal(Marshaller marsh) throws IgniteCheckedException { - // No-op. - } - - /** - * @param marsh Marshaller. - * @param ldr Class loader. - * @throws IgniteCheckedException In case of error. - */ - public void finishUnmarshal(Marshaller marsh, @Nullable ClassLoader ldr) throws IgniteCheckedException { - // No-op. - } - - /** {@inheritDoc} */ - @Override public boolean writeTo(ByteBuffer buf) { - writer.setBuffer(buf); - - if (!typeWritten) { - if (!writer.writeByte(null, directType())) - return false; - - typeWritten = true; - } - - return true; - } - - /** {@inheritDoc} */ - @Override public boolean readFrom(ByteBuffer buf) { - reader.setBuffer(buf); - - return true; - } -} http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/141f8282/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsContext.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsContext.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsContext.java deleted file mode 100644 index e122a2c..0000000 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/fs/IgfsContext.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.ignite.internal.processors.fs; - -import org.apache.ignite.*; -import org.apache.ignite.cluster.*; -import org.apache.ignite.configuration.*; -import org.apache.ignite.internal.*; -import org.apache.ignite.internal.managers.communication.*; -import org.apache.ignite.internal.util.typedef.*; -import org.jetbrains.annotations.*; - -import java.util.*; - -import static org.apache.ignite.internal.IgniteNodeAttributes.*; - -/** - * GGFS context holding all required components for GGFS instance. - */ -public class IgfsContext { - /** Kernal context. */ - private final GridKernalContext ctx; - - /** Configuration. */ - private final IgfsConfiguration cfg; - - /** Managers. */ - private List<IgfsManager> mgrs = new LinkedList<>(); - - /** Meta manager. */ - private final IgfsMetaManager metaMgr; - - /** Data manager. */ - private final IgfsDataManager dataMgr; - - /** Server manager. */ - private final IgfsServerManager srvMgr; - - /** Fragmentizer manager. */ - private final IgfsFragmentizerManager fragmentizerMgr; - - /** GGFS instance. */ - private final IgfsEx ggfs; - - /** - * @param ctx Kernal context. - * @param cfg GGFS configuration. - * @param metaMgr Meta manager. - * @param dataMgr Data manager. - * @param srvMgr Server manager. - * @param fragmentizerMgr Fragmentizer manager. - * @throws IgniteCheckedException If GGFs context instantiation is failed. - */ - public IgfsContext( - GridKernalContext ctx, - IgfsConfiguration cfg, - IgfsMetaManager metaMgr, - IgfsDataManager dataMgr, - IgfsServerManager srvMgr, - IgfsFragmentizerManager fragmentizerMgr - ) throws IgniteCheckedException { - this.ctx = ctx; - this.cfg = cfg; - - this.metaMgr = add(metaMgr); - this.dataMgr = add(dataMgr); - this.srvMgr = add(srvMgr); - this.fragmentizerMgr = add(fragmentizerMgr); - - ggfs = new IgfsImpl(this); - } - - /** - * @return GGFS instance. - */ - public IgfsEx ggfs() { - return ggfs; - } - - /** - * @return Kernal context. - */ - public GridKernalContext kernalContext() { - return ctx; - } - - /** - * @return GGFS configuration. - */ - public IgfsConfiguration configuration() { - return cfg; - } - - /** - * @return List of managers, in starting order. - */ - public List<IgfsManager> managers() { - return mgrs; - } - - /** - * @return Meta manager. - */ - public IgfsMetaManager meta() { - return metaMgr; - } - - /** - * @return Data manager. - */ - public IgfsDataManager data() { - return dataMgr; - } - - /** - * @return Server manager. - */ - public IgfsServerManager server() { - return srvMgr; - } - - /** - * @return Fragmentizer manager. - */ - public IgfsFragmentizerManager fragmentizer() { - return fragmentizerMgr; - } - - /** - * @param nodeId Node ID. - * @param topic Topic. - * @param msg Message. - * @param plc Policy. - * @throws IgniteCheckedException In case of error. - */ - public void send(UUID nodeId, Object topic, IgfsCommunicationMessage msg, GridIoPolicy plc) - throws IgniteCheckedException { - if (!kernalContext().localNodeId().equals(nodeId)) - msg.prepareMarshal(kernalContext().config().getMarshaller()); - - kernalContext().io().send(nodeId, topic, msg, plc); - } - - /** - * @param node Node. - * @param topic Topic. - * @param msg Message. - * @param plc Policy. - * @throws IgniteCheckedException In case of error. - */ - public void send(ClusterNode node, Object topic, IgfsCommunicationMessage msg, GridIoPolicy plc) - throws IgniteCheckedException { - if (!kernalContext().localNodeId().equals(node.id())) - msg.prepareMarshal(kernalContext().config().getMarshaller()); - - kernalContext().io().send(node, topic, msg, plc); - } - - /** - * Checks if given node is a GGFS node. - * - * @param node Node to check. - * @return {@code True} if node has GGFS with this name, {@code false} otherwise. - */ - public boolean ggfsNode(ClusterNode node) { - assert node != null; - - IgfsAttributes[] ggfs = node.attribute(ATTR_GGFS); - - if (ggfs != null) - for (IgfsAttributes attrs : ggfs) - if (F.eq(cfg.getName(), attrs.ggfsName())) - return true; - - return false; - } - - /** - * Adds manager to managers list. - * - * @param mgr Manager. - * @return Added manager. - */ - private <T extends IgfsManager> T add(@Nullable T mgr) { - if (mgr != null) - mgrs.add(mgr); - - return mgr; - } -}