Java Code Examples for java.util.concurrent.locks.ReadWriteLock
The following examples show how to use
java.util.concurrent.locks.ReadWriteLock. These examples are extracted from open source projects.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: stitch-android-sdk Source File: CoreDocumentSynchronizationConfig.java License: Apache License 2.0 | 6 votes |
private CoreDocumentSynchronizationConfig( final MongoCollection<CoreDocumentSynchronizationConfig> docsColl, final MongoNamespace namespace, final BsonValue documentId, final ChangeEvent<BsonDocument> lastUncommittedChangeEvent, final long lastResolution, final BsonDocument lastVersion, final ReadWriteLock docsLock, final boolean isStale, final boolean isPaused, final long lastKnownHash ) { this.docsColl = docsColl; this.namespace = namespace; this.documentId = documentId; this.lastResolution = lastResolution; this.lastKnownRemoteVersion = lastVersion; this.lastUncommittedChangeEvent = lastUncommittedChangeEvent; this.docLock = docsLock; this.isStale = isStale; this.isPaused = isPaused; this.lastKnownHash = lastKnownHash; }
Example 2
Source Project: linstor-server Source File: UpdateMonitorImpl.java License: GNU General Public License v3.0 | 6 votes |
@Inject public UpdateMonitorImpl( @Named(CoreModule.RECONFIGURATION_LOCK) ReadWriteLock reconfigurationLockRef, @Named(CoreModule.NODES_MAP_LOCK) ReadWriteLock nodesMapLockRef, @Named(CoreModule.RSC_DFN_MAP_LOCK) ReadWriteLock rscDfnMapLockRef, @Named(CoreModule.STOR_POOL_DFN_MAP_LOCK) ReadWriteLock storPoolDfnMapLockRef ) { reconfigurationLock = reconfigurationLockRef; nodesMapLock = nodesMapLockRef; rscDfnMapLock = rscDfnMapLockRef; storPoolDfnMapLock = storPoolDfnMapLockRef; // Don't start with 0 to ensure the controller mirrors our fullSyncId fullSyncId = new AtomicLong(2); awaitedUpdateId = new AtomicLong(0); }
Example 3
Source Project: dremio-oss Source File: RocksDBStore.java License: Apache License 2.0 | 6 votes |
public RocksDBStore(String name, ColumnFamilyDescriptor family, ColumnFamilyHandle handle, RocksDB db, int stripes, MetaManager metaManager) { super(); this.family = family; this.name = name; this.db = db; this.parallel = stripes; this.handle = handle; this.sharedLocks = new AutoCloseableLock[stripes]; this.exclusiveLocks = new AutoCloseableLock[stripes]; this.metaManager = metaManager; for (int i = 0; i < stripes; i++) { ReadWriteLock core = new ReentrantReadWriteLock(); sharedLocks[i] = new AutoCloseableLock(core.readLock()); exclusiveLocks[i] = new AutoCloseableLock(core.writeLock()); } registerMetrics(); }
Example 4
Source Project: hadoop Source File: ContainerImpl.java License: Apache License 2.0 | 6 votes |
public ContainerImpl(Configuration conf, Dispatcher dispatcher, NMStateStoreService stateStore, ContainerLaunchContext launchContext, Credentials creds, NodeManagerMetrics metrics, ContainerTokenIdentifier containerTokenIdentifier) { this.daemonConf = conf; this.dispatcher = dispatcher; this.stateStore = stateStore; this.launchContext = launchContext; this.containerTokenIdentifier = containerTokenIdentifier; this.containerId = containerTokenIdentifier.getContainerID(); this.resource = containerTokenIdentifier.getResource(); this.diagnostics = new StringBuilder(); this.credentials = creds; this.metrics = metrics; user = containerTokenIdentifier.getApplicationSubmitter(); ReadWriteLock readWriteLock = new ReentrantReadWriteLock(); this.readLock = readWriteLock.readLock(); this.writeLock = readWriteLock.writeLock(); stateMachine = stateMachineFactory.make(this); }
Example 5
Source Project: summerframework Source File: LockInstance.java License: Apache License 2.0 | 6 votes |
public LockInstance createLockIfNotExist() { if (getLock() != null) { return this; } Assert.notNull(getName(), "Lock name can not be null"); switch (getType()) { case DEFAULT: Lock lock = lockFactory.getLock(this); this.setLock(lock); break; case READ: ReadWriteLock read = lockFactory.getReadWriteLock(this); this.setReadWriteLock(read); this.setLock(read.readLock()); break; case WRITE: ReadWriteLock write = lockFactory.getReadWriteLock(this); this.setReadWriteLock(write); this.setLock(write.writeLock()); break; default: Assert.notNull(this.getType(), "LockType cant not be null"); break; } return this; }
Example 6
Source Project: linstor-server Source File: StltApiCallHandlerUtils.java License: GNU General Public License v3.0 | 6 votes |
@Inject public StltApiCallHandlerUtils( ErrorReporter errorReporterRef, @ApiContext AccessContext apiCtxRef, ControllerPeerConnector controllerPeerConnectorRef, @Named(CoreModule.NODES_MAP_LOCK) ReadWriteLock nodesMapLockRef, @Named(CoreModule.STOR_POOL_DFN_MAP_LOCK) ReadWriteLock storPoolDfnMapLockRef, @Named(CoreModule.RSC_DFN_MAP_LOCK) ReadWriteLock rscDfnMapLockRef, StorageLayer storageLayerRef, DeviceProviderMapper deviceProviderMapperRef, LockGuardFactory lockGuardFactoryRef, Provider<DeviceManager> devMgrProviderRef ) { errorReporter = errorReporterRef; apiCtx = apiCtxRef; controllerPeerConnector = controllerPeerConnectorRef; nodesMapLock = nodesMapLockRef; storPoolDfnMapLock = storPoolDfnMapLockRef; rscDfnMapLock = rscDfnMapLockRef; storageLayer = storageLayerRef; deviceProviderMapper = deviceProviderMapperRef; lockGuardFactory = lockGuardFactoryRef; devMgr = devMgrProviderRef; }
Example 7
Source Project: localization_nifi Source File: EventFileManager.java License: Apache License 2.0 | 6 votes |
public void releaseWriteLock(final File file) { final String key = getMapKey(file); boolean updated = false; while (!updated) { final Tuple<ReadWriteLock, Integer> tuple = lockMap.get(key); if (tuple == null) { throw new IllegalMonitorStateException("Lock is not owned"); } // If this is the only reference to the lock, remove it from the map and then unlock. if (tuple.getValue() <= 1) { updated = lockMap.remove(key, tuple); if (updated) { tuple.getKey().writeLock().unlock(); } } else { final Tuple<ReadWriteLock, Integer> updatedTuple = new Tuple<>(tuple.getKey(), tuple.getValue() - 1); updated = lockMap.replace(key, tuple, updatedTuple); if (updated) { tuple.getKey().writeLock().unlock(); } } } }
Example 8
Source Project: linstor-server Source File: ControllerDebugModule.java License: GNU General Public License v3.0 | 6 votes |
@Provides CmdDisplayNodes cmdDisplayNodes( @Named(CoreModule.RECONFIGURATION_LOCK) ReadWriteLock reconfigurationLockRef, @Named(CoreModule.NODES_MAP_LOCK) ReadWriteLock nodesMapLockRef, NodeRepository nodeRepository, CoreModule.NodesMap nodesMap ) throws AccessDeniedException { return new CmdDisplayNodes( reconfigurationLockRef, nodesMapLockRef, nodeRepository::getObjProt, nodesMap ); }
Example 9
Source Project: linstor-server Source File: ControllerDebugModule.java License: GNU General Public License v3.0 | 6 votes |
@Provides CmdDisplayResourceDfn cmdDisplayResourceDfn( @Named(CoreModule.RECONFIGURATION_LOCK) ReadWriteLock reconfigurationLockRef, @Named(CoreModule.RSC_DFN_MAP_LOCK) ReadWriteLock rscDfnMapLockRef, ResourceDefinitionRepository resourceDefinitionRepository, CoreModule.ResourceDefinitionMap resourceDefinitionMap ) throws AccessDeniedException { return new CmdDisplayResourceDfn( reconfigurationLockRef, rscDfnMapLockRef, resourceDefinitionRepository::getObjProt, resourceDefinitionMap ); }
Example 10
Source Project: linstor-server Source File: SatelliteCoreModule.java License: GNU General Public License v3.0 | 6 votes |
@Override protected void configure() { bind(String.class).annotatedWith(Names.named(CoreModule.MODULE_NAME)) .toInstance(LinStor.SATELLITE_MODULE); bind(ReadWriteLock.class).annotatedWith(Names.named(STLT_CONF_LOCK)) .toInstance(new ReentrantReadWriteLock(true)); bind(ControllerPeerConnector.class).to(ControllerPeerConnectorImpl.class); // bind(UpdateMonitor.class).to(UpdateMonitorImpl.class); // bind(DeviceManager.class).to(DeviceManagerImpl.class); // install(new FactoryModuleBuilder() // .implement(DeviceManagerImpl.DeviceHandlerInvocation.class, // DeviceManagerImpl.DeviceHandlerInvocation.class) // .build(DeviceManagerImpl.DeviceHandlerInvocationFactory.class)); bind(Path.class).annotatedWith(Names.named(DRBD_CONFIG_PATH)).toInstance( FileSystems.getDefault().getPath(CoreModule.CONFIG_PATH) ); }
Example 11
Source Project: linstor-server Source File: VlmAllocatedFetcherProto.java License: GNU General Public License v3.0 | 6 votes |
@Inject public VlmAllocatedFetcherProto( ScopeRunner scopeRunnerRef, CtrlStltSerializer ctrlStltSerializerRef, @Named(CoreModule.NODES_MAP_LOCK) ReadWriteLock nodesMapLockRef, @Named(CoreModule.RSC_DFN_MAP_LOCK) ReadWriteLock rscDfnMapLockRef, @Named(CoreModule.STOR_POOL_DFN_MAP_LOCK) ReadWriteLock storPoolDfnMapLockRef, CtrlApiDataLoader ctrlApiDataLoaderRef, NodeRepository nodeRepositoryRef, @PeerContext Provider<AccessContext> peerAccCtxRef ) { scopeRunner = scopeRunnerRef; ctrlStltSerializer = ctrlStltSerializerRef; nodesMapLock = nodesMapLockRef; rscDfnMapLock = rscDfnMapLockRef; storPoolDfnMapLock = storPoolDfnMapLockRef; ctrlApiDataLoader = ctrlApiDataLoaderRef; nodeRepository = nodeRepositoryRef; peerAccCtx = peerAccCtxRef; }
Example 12
Source Project: LearningOfThinkInJava Source File: ReadWriteLockDemo1.java License: Apache License 2.0 | 6 votes |
public static void main(String[] args) { //创建并发访问的账户 MyCount myCount = new MyCount("95599200901215522", 10000); //创建一个锁对象 ReadWriteLock lock = new ReentrantReadWriteLock(false); //创建一个线程池 ExecutorService pool = Executors.newFixedThreadPool(2); //创建一些并发访问用户,一个信用卡,存的存,取的取,好热闹啊 User u1 = new User("张三", myCount, -4000, lock, true); User u2 = new User("张三他爹", myCount, 6000, lock, false); User u3 = new User("张三他弟", myCount, -8000, lock, false); User u4 = new User("张三", myCount, 800, lock, false); User u5 = new User("张三他爹", myCount, 0, lock, true); //在线程池中执行各个用户的操作 pool.execute(u1); pool.execute(u2); pool.execute(u3); pool.execute(u4); pool.execute(u5); //关闭线程池 pool.shutdown(); }
Example 13
Source Project: linstor-server Source File: NodeInternalCallHandler.java License: GNU General Public License v3.0 | 6 votes |
@Inject public NodeInternalCallHandler( ErrorReporter errorReporterRef, @ApiContext AccessContext apiCtxRef, CtrlStltSerializer ctrlStltSerializerRef, Provider<Peer> peerRef, @Named(CoreModule.NODES_MAP_LOCK) ReadWriteLock nodesMapLockRef, CtrlApiDataLoader ctrlApiDataLoaderRef ) { errorReporter = errorReporterRef; apiCtx = apiCtxRef; ctrlStltSerializer = ctrlStltSerializerRef; peer = peerRef; nodesMapLock = nodesMapLockRef; ctrlApiDataLoader = ctrlApiDataLoaderRef; }
Example 14
Source Project: linstor-server Source File: CtrlFullSyncResponseApiCallHandler.java License: GNU General Public License v3.0 | 6 votes |
@Inject public CtrlFullSyncResponseApiCallHandler( @ApiContext AccessContext apiCtxRef, ScopeRunner scopeRunnerRef, CtrlSatelliteConnectionNotifier ctrlSatelliteConnectionNotifierRef, @Named(CoreModule.NODES_MAP_LOCK) ReadWriteLock nodesMapLockRef, @Named(CoreModule.RSC_DFN_MAP_LOCK) ReadWriteLock rscDfnMapLockRef, Provider<Peer> satelliteProviderRef ) { apiCtx = apiCtxRef; scopeRunner = scopeRunnerRef; ctrlSatelliteConnectionNotifier = ctrlSatelliteConnectionNotifierRef; nodesMapLock = nodesMapLockRef; rscDfnMapLock = rscDfnMapLockRef; satelliteProvider = satelliteProviderRef; }
Example 15
Source Project: linstor-server Source File: StorPoolInternalCallHandler.java License: GNU General Public License v3.0 | 6 votes |
@Inject public StorPoolInternalCallHandler( ErrorReporter errorReporterRef, @ApiContext AccessContext apiCtxRef, CtrlTransactionHelper ctrlTransactionHelperRef, CtrlApiDataLoader ctrlApiDataLoaderRef, ResponseConverter responseConverterRef, CtrlStltSerializer ctrlStltSerializerRef, Provider<Peer> peerRef, @PeerContext Provider<AccessContext> peerAccCtxRef, @Named(CoreModule.NODES_MAP_LOCK) ReadWriteLock nodesMapLockRef, @Named(CoreModule.STOR_POOL_DFN_MAP_LOCK) ReadWriteLock storPoolDfnMapLockRef ) { errorReporter = errorReporterRef; apiCtx = apiCtxRef; ctrlTransactionHelper = ctrlTransactionHelperRef; ctrlApiDataLoader = ctrlApiDataLoaderRef; responseConverter = responseConverterRef; ctrlStltSerializer = ctrlStltSerializerRef; peer = peerRef; peerAccCtx = peerAccCtxRef; nodesMapLock = nodesMapLockRef; storPoolDfnMapLock = storPoolDfnMapLockRef; }
Example 16
Source Project: linstor-server Source File: CtrlDrbdProxyEnableApiCallHandler.java License: GNU General Public License v3.0 | 6 votes |
@Inject public CtrlDrbdProxyEnableApiCallHandler( @ApiContext AccessContext apiCtxRef, ScopeRunner scopeRunnerRef, CtrlTransactionHelper ctrlTransactionHelperRef, CtrlSatelliteUpdateCaller ctrlSatelliteUpdateCallerRef, CtrlApiDataLoader ctrlApiDataLoaderRef, ResponseConverter responseConverterRef, @Named(CoreModule.NODES_MAP_LOCK) ReadWriteLock nodesMapLockRef, @Named(CoreModule.RSC_DFN_MAP_LOCK) ReadWriteLock rscDfnMapLockRef, CtrlDrbdProxyHelper drbdProxyHelperRef ) { apiCtx = apiCtxRef; scopeRunner = scopeRunnerRef; ctrlTransactionHelper = ctrlTransactionHelperRef; ctrlSatelliteUpdateCaller = ctrlSatelliteUpdateCallerRef; ctrlApiDataLoader = ctrlApiDataLoaderRef; responseConverter = responseConverterRef; nodesMapLock = nodesMapLockRef; rscDfnMapLock = rscDfnMapLockRef; drbdProxyHelper = drbdProxyHelperRef; }
Example 17
Source Project: linstor-server Source File: LockGuardFactory.java License: GNU General Public License v3.0 | 6 votes |
@Inject public LockGuardFactory( @Named(CoreModule.RECONFIGURATION_LOCK) ReadWriteLock reconfigurationLockRef, @Named(CoreModule.NODES_MAP_LOCK) ReadWriteLock nodesMapLockRef, @Named(CoreModule.RSC_DFN_MAP_LOCK) ReadWriteLock rscDfnMapLockRef, @Named(CoreModule.STOR_POOL_DFN_MAP_LOCK) ReadWriteLock storPoolDfnMapLockRef, @Named(CoreModule.CTRL_CONF_LOCK) ReadWriteLock ctrlConfigLockRef, @Named(CoreModule.KVS_MAP_LOCK) ReadWriteLock kvsMapLockRef, @Named(CoreModule.RSC_GROUP_MAP_LOCK) ReadWriteLock rscGrpMapLockRef ) { reconfigurationLock = reconfigurationLockRef; nodesMapLock = nodesMapLockRef; rscDfnMapLock = rscDfnMapLockRef; storPoolDfnMapLock = storPoolDfnMapLockRef; ctrlConfigLock = ctrlConfigLockRef; kvsMapLock = kvsMapLockRef; rscGrpMapLock = rscGrpMapLockRef; }
Example 18
Source Project: jstarcraft-core Source File: LuceneEngine.java License: Apache License 2.0 | 6 votes |
public LuceneEngine(IndexWriterConfig config, Path path) { try { this.config = config; Directory transienceDirectory = new ByteBuffersDirectory(); this.transienceManager = new TransienceManager((IndexWriterConfig) BeanUtils.cloneBean(config), transienceDirectory); Directory persistenceDirectory = FSDirectory.open(path); this.persistenceManager = new PersistenceManager((IndexWriterConfig) BeanUtils.cloneBean(config), persistenceDirectory); this.searcher = new LuceneSearcher(this.transienceManager, this.persistenceManager); this.semaphore = new AtomicInteger(); ReadWriteLock lock = new ReentrantReadWriteLock(); this.readLock = lock.readLock(); this.writeLock = lock.writeLock(); } catch (Exception exception) { throw new StorageException(exception); } }
Example 19
Source Project: linstor-server Source File: CmdDisplayLockStatus.java License: GNU General Public License v3.0 | 6 votes |
private void reportRwLock(PrintStream output, String label, ReadWriteLock readWriteLock) { ReentrantReadWriteLock reentrantReadWriteLock = (ReentrantReadWriteLock) readWriteLock; boolean writeLocked = reentrantReadWriteLock.isWriteLocked(); boolean fair = reentrantReadWriteLock.isFair(); boolean queued = reentrantReadWriteLock.hasQueuedThreads(); int readerCount = reentrantReadWriteLock.getReadLockCount(); output.printf( RWLOCK_FORMAT, label, writeLocked ? "Y" : "N", fair ? "Y" : "N", queued ? "Y" : "N", readerCount ); }
Example 20
Source Project: linstor-server Source File: SatelliteDebugModule.java License: GNU General Public License v3.0 | 5 votes |
@Provides CmdDisplayResourceDfn cmdDisplayResourceDfn( @Named(CoreModule.RECONFIGURATION_LOCK) ReadWriteLock reconfigurationLockRef, @Named(CoreModule.RSC_DFN_MAP_LOCK) ReadWriteLock rscDfnMapLockRef, CoreModule.ResourceDefinitionMap rscDfnMapRef ) { return new CmdDisplayResourceDfn(reconfigurationLockRef, rscDfnMapLockRef, null, rscDfnMapRef); }
Example 21
Source Project: Flink-CEPplus Source File: BlobServerConnection.java License: Apache License 2.0 | 5 votes |
/** * Creates a new BLOB connection for a client request. * * @param clientSocket The socket to read/write data. * @param blobServer The BLOB server. */ BlobServerConnection(Socket clientSocket, BlobServer blobServer) { super("BLOB connection for " + clientSocket.getRemoteSocketAddress()); setDaemon(true); this.clientSocket = clientSocket; this.blobServer = checkNotNull(blobServer); ReadWriteLock readWriteLock = blobServer.getReadWriteLock(); this.readLock = readWriteLock.readLock(); }
Example 22
Source Project: LearningOfThinkInJava Source File: ReadWriteLockDemo1.java License: Apache License 2.0 | 5 votes |
User(String name, MyCount myCount, int iocash, ReadWriteLock myLock, boolean ischeck) { this.name = name; this.myCount = myCount; this.iocash = iocash; this.myLock = myLock; this.ischeck = ischeck; }
Example 23
Source Project: azeroth Source File: MemoryTokenStore.java License: Apache License 2.0 | 5 votes |
public MemoryTokenStore() { this.cache = CacheBuilder.newBuilder().softValues().expireAfterAccess(120, TimeUnit.SECONDS) .build(); ReadWriteLock lock = new ReentrantReadWriteLock(); this.r = lock.readLock(); this.w = lock.writeLock(); }
Example 24
Source Project: strongbox Source File: DynamoDB.java License: Apache License 2.0 | 5 votes |
public static DynamoDB fromCredentials(AWSCredentialsProvider awsCredentials, ClientConfiguration clientConfiguration, SecretsGroupIdentifier groupIdentifier, ReadWriteLock readWriteLock) { AmazonDynamoDB client = AmazonDynamoDBClientBuilder.standard() .withCredentials(awsCredentials) .withClientConfiguration(verifyOrThrow(transformAndVerifyOrThrow(clientConfiguration))) .withRegion(groupIdentifier.region.getName()) .build(); return new DynamoDB(client, awsCredentials, clientConfiguration, groupIdentifier, readWriteLock); }
Example 25
Source Project: TeaStore Source File: DriveStorage.java License: Apache License 2.0 | 5 votes |
@Override public boolean saveData(StoreImage data) { // We return true so we do not trigger an error. This is intended if (!dataIsStorable(data)) { return true; } Path imgFile = workingDir.resolve(Long.toString(data.getId())); if (imgFile.toFile().exists()) { return true; } ReadWriteLock l = getIDLock(data.getId()); l.writeLock().lock(); try { Files.write(imgFile, data.getByteArray(), StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.TRUNCATE_EXISTING); } catch (IOException ioException) { log.warn("An IOException occured while trying to write the file \"" + imgFile.toAbsolutePath() + "\" to disk.", ioException); return false; } finally { l.writeLock().unlock(); } return true; }
Example 26
Source Project: hadoop Source File: KeyAuthorizationKeyProvider.java License: Apache License 2.0 | 5 votes |
/** * The constructor takes a {@link KeyProviderCryptoExtension} and an * implementation of <code>KeyACLs</code>. All calls are delegated to the * provider keyProvider after authorization check (if required) * @param keyProvider * @param acls */ public KeyAuthorizationKeyProvider(KeyProviderCryptoExtension keyProvider, KeyACLs acls) { super(keyProvider, null); this.provider = keyProvider; this.acls = acls; ReadWriteLock lock = new ReentrantReadWriteLock(true); readLock = lock.readLock(); writeLock = lock.writeLock(); }
Example 27
Source Project: localization_nifi Source File: EventFileManager.java License: Apache License 2.0 | 5 votes |
private ReadWriteLock updateCount(final File file, final Function<Integer, Integer> update) { final String key = getMapKey(file); boolean updated = false; Tuple<ReadWriteLock, Integer> updatedTuple = null; while (!updated) { final Tuple<ReadWriteLock, Integer> tuple = lockMap.computeIfAbsent(key, k -> new Tuple<>(new ReentrantReadWriteLock(), 0)); final Integer updatedCount = update.apply(tuple.getValue()); updatedTuple = new Tuple<>(tuple.getKey(), updatedCount); updated = lockMap.replace(key, tuple, updatedTuple); } return updatedTuple.getKey(); }
Example 28
Source Project: sailfish-core Source File: DefaultConnectionManager.java License: Apache License 2.0 | 5 votes |
@SuppressWarnings("ProhibitedExceptionCaught") private <T> T withReadLock(ReadWriteLock lock, CheckedSupplier<T> supplier) { try { lock.readLock().lock(); return supplier.get(); } catch (Throwable t) { return ExceptionUtils.rethrow(t); } finally { lock.readLock().unlock(); } }
Example 29
Source Project: linstor-server Source File: StltNodeApiCallHandler.java License: GNU General Public License v3.0 | 5 votes |
@Inject StltNodeApiCallHandler( ErrorReporter errorReporterRef, @ApiContext AccessContext apiCtxRef, DeviceManager deviceManagerRef, @Named(CoreModule.RECONFIGURATION_LOCK) ReadWriteLock reconfigurationLockRef, @Named(CoreModule.NODES_MAP_LOCK) ReadWriteLock nodesMapLockRef, CoreModule.NodesMap nodesMapRef, NodeSatelliteFactory nodeFactoryRef, NodeConnectionFactory nodeConnectionFactoryRef, NetInterfaceFactory netInterfaceFactoryRef, ControllerPeerConnector controllerPeerConnectorRef, Provider<TransactionMgr> transMgrProviderRef ) { errorReporter = errorReporterRef; apiCtx = apiCtxRef; deviceManager = deviceManagerRef; reconfigurationLock = reconfigurationLockRef; nodesMapLock = nodesMapLockRef; nodesMap = nodesMapRef; nodeFactory = nodeFactoryRef; nodeConnectionFactory = nodeConnectionFactoryRef; netInterfaceFactory = netInterfaceFactoryRef; controllerPeerConnector = controllerPeerConnectorRef; transMgrProvider = transMgrProviderRef; }
Example 30
Source Project: hadoop Source File: LocalizedResource.java License: Apache License 2.0 | 5 votes |
public LocalizedResource(LocalResourceRequest rsrc, Dispatcher dispatcher) { this.rsrc = rsrc; this.dispatcher = dispatcher; this.ref = new LinkedList<ContainerId>(); ReadWriteLock readWriteLock = new ReentrantReadWriteLock(); this.readLock = readWriteLock.readLock(); this.writeLock = readWriteLock.writeLock(); this.stateMachine = stateMachineFactory.make(this); }