michael-o commented on code in PR #185: URL: https://github.com/apache/maven-resolver/pull/185#discussion_r906287147
########## maven-resolver-named-locks/src/site/markdown/index.md.vm: ########## @@ -23,28 +23,41 @@ Named locks are essentially locks that are assigned to some given (opaque) ID. I resources that each can have unique ID assigned (i.e., file with an absolute path, some entities with unique ID), then you can use named locks to make sure they are being protected from concurrent read and write actions. -Named locks provide support classes for implementations, and provide out of the box seven named lock implementations and three name mappers. +Named locks provide support classes for implementations, and provide out of the box several lock and name mapper implementations. -Out of the box, "local" (local to JVM) named lock implementations are the following: +Following implementations are "local" (local to JVM) named lock implementations: - `rwlock-local` implemented in `org.eclipse.aether.named.providers.LocalReadWriteLockNamedLockFactory` that uses JVM `java.util.concurrent.locks.ReentrantReadWriteLock`. - `semaphore-local` implemented in `org.eclipse.aether.named.providers.LocalSemaphoreNamedLockFactory` that uses JVM `java.util.concurrent.Semaphore`. +- `noop` implemented in `org.eclipse.aether.named.providers.NoopNamedLockFactory` that uses no locking. + +Note about "local" locks: they are in-JVM, in a way, they properly coordinate in case of multithreaded access from +same JVM, but does not cover accesses across multiple processes and multiple hosts access. Review Comment: but do not cover access ########## maven-resolver-named-locks/src/site/markdown/index.md.vm: ########## @@ -23,28 +23,41 @@ Named locks are essentially locks that are assigned to some given (opaque) ID. I resources that each can have unique ID assigned (i.e., file with an absolute path, some entities with unique ID), then you can use named locks to make sure they are being protected from concurrent read and write actions. -Named locks provide support classes for implementations, and provide out of the box seven named lock implementations and three name mappers. +Named locks provide support classes for implementations, and provide out of the box several lock and name mapper implementations. -Out of the box, "local" (local to JVM) named lock implementations are the following: +Following implementations are "local" (local to JVM) named lock implementations: - `rwlock-local` implemented in `org.eclipse.aether.named.providers.LocalReadWriteLockNamedLockFactory` that uses JVM `java.util.concurrent.locks.ReentrantReadWriteLock`. - `semaphore-local` implemented in `org.eclipse.aether.named.providers.LocalSemaphoreNamedLockFactory` that uses JVM `java.util.concurrent.Semaphore`. +- `noop` implemented in `org.eclipse.aether.named.providers.NoopNamedLockFactory` that uses no locking. + +Note about "local" locks: they are in-JVM, in a way, they properly coordinate in case of multithreaded access from +same JVM, but does not cover accesses across multiple processes and multiple hosts access. +In other words, local named locks are only suited within one JVM with a multithreaded access. + +Following named lock implementations use underlying OS advisory file locking: + - `file-lock` implemented in `org.eclipse.aether.named.providers.FileLockNamedLockFactory` that uses JVM `java.nio.channels.FileLock`. -- `noop` implemented in `org.eclipse.aether.named.providers.NoopNamedLockFactory` that uses no locking. -Out of the box, "distributed" named lock implementations are the following (separate modules which require additional dependencies): +The `file-lock` implementation uses OS advisory file locking, hence, concurrently running Maven processes Review Comment: same ########## src/site/markdown/local-repository.md: ########## @@ -160,3 +146,36 @@ class that provides all the defaults. The factory should create a stateless instance of a composer configured from passed in session, that will be used with the enhanced LRM throughout the session. + +### Simple LRM + +Simple is a fully functional LRM implementation, but is used +mainly in tests, it is not recommended in production environments. + +To manually instantiate a simple LRM, one needs to invoke following code: + +```java +LocalRepositoryManager simple = new SimpleLocalRepositoryManagerFactory() + .newInstance( session, new LocalRepository( baseDir ) ); +``` + +Note: This code snippet above instantiates a component, that is not +recommended way to use it, as it should be rather injected whenever possible. +This example above is merely a showcase how to obtain LRM implementation +in unit tests. + +## Shared access to Local Repository Review Comment: Access ########## maven-resolver-named-locks/src/site/markdown/index.md.vm: ########## @@ -23,28 +23,41 @@ Named locks are essentially locks that are assigned to some given (opaque) ID. I resources that each can have unique ID assigned (i.e., file with an absolute path, some entities with unique ID), then you can use named locks to make sure they are being protected from concurrent read and write actions. -Named locks provide support classes for implementations, and provide out of the box seven named lock implementations and three name mappers. +Named locks provide support classes for implementations, and provide out of the box several lock and name mapper implementations. -Out of the box, "local" (local to JVM) named lock implementations are the following: +Following implementations are "local" (local to JVM) named lock implementations: - `rwlock-local` implemented in `org.eclipse.aether.named.providers.LocalReadWriteLockNamedLockFactory` that uses JVM `java.util.concurrent.locks.ReentrantReadWriteLock`. - `semaphore-local` implemented in `org.eclipse.aether.named.providers.LocalSemaphoreNamedLockFactory` that uses JVM `java.util.concurrent.Semaphore`. +- `noop` implemented in `org.eclipse.aether.named.providers.NoopNamedLockFactory` that uses no locking. + +Note about "local" locks: they are in-JVM, in a way, they properly coordinate in case of multithreaded access from +same JVM, but does not cover accesses across multiple processes and multiple hosts access. +In other words, local named locks are only suited within one JVM with a multithreaded access. + +Following named lock implementations use underlying OS advisory file locking: Review Comment: OS => file system Since it depends on the FS, not really the OS ########## maven-resolver-named-locks/src/site/markdown/index.md.vm: ########## @@ -23,28 +23,41 @@ Named locks are essentially locks that are assigned to some given (opaque) ID. I resources that each can have unique ID assigned (i.e., file with an absolute path, some entities with unique ID), then you can use named locks to make sure they are being protected from concurrent read and write actions. -Named locks provide support classes for implementations, and provide out of the box seven named lock implementations and three name mappers. +Named locks provide support classes for implementations, and provide out of the box several lock and name mapper implementations. -Out of the box, "local" (local to JVM) named lock implementations are the following: +Following implementations are "local" (local to JVM) named lock implementations: - `rwlock-local` implemented in `org.eclipse.aether.named.providers.LocalReadWriteLockNamedLockFactory` that uses JVM `java.util.concurrent.locks.ReentrantReadWriteLock`. - `semaphore-local` implemented in `org.eclipse.aether.named.providers.LocalSemaphoreNamedLockFactory` that uses JVM `java.util.concurrent.Semaphore`. +- `noop` implemented in `org.eclipse.aether.named.providers.NoopNamedLockFactory` that uses no locking. + +Note about "local" locks: they are in-JVM, in a way, they properly coordinate in case of multithreaded access from +same JVM, but does not cover accesses across multiple processes and multiple hosts access. Review Comment: processes and/or multiple hosts -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org