forked from dCache/dcache
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dcache: Replaced org.dcache.util.list.DirectoryStream with java.nio.f…
…ile.DirectoryStream Motivation: Since java7 is already released for years, we can finally drop the custom interface and adopt it's JDK provided analogue Modification: Removed org.dcache.util.list.DirectoryStream and replaced it with java.nio.file.DirectoryStream, adding a few catch clauses and generic type casts Result: dcache now uses java.nio.file.DirectoryStream and org.dcache.util.list.DirectoryStream could be deleted Fixes: #gh-issue Ticket: dCache#3821 Target: master Signed-off-by: JPOstholt <[email protected]>
- Loading branch information
Showing
19 changed files
with
2,021 additions
and
1,072 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
...pes/dcache-nearline-plugin-archetype/target/classes/META-INF/maven/archetype-metadata.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<archetype-descriptor | ||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" | ||
name="xrootd4j-channelhandler-plugin" | ||
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
<requiredProperties> | ||
<requiredProperty key="dcache"> | ||
<defaultValue>5.1.0-SNAPSHOT</defaultValue> | ||
</requiredProperty> | ||
<requiredProperty key="name"> | ||
<defaultValue>${package}.${artifactId}</defaultValue> | ||
</requiredProperty> | ||
<requiredProperty key="description"/> | ||
</requiredProperties> | ||
<fileSets> | ||
<fileSet filtered="true" packaged="true" encoding="UTF-8"> | ||
<directory>src/main/java</directory> | ||
<includes> | ||
<include>**/*.java</include> | ||
</includes> | ||
</fileSet> | ||
<fileSet filtered="true" encoding="UTF-8"> | ||
<directory>src/main/assembly</directory> | ||
<includes> | ||
<include>**/*.xml</include> | ||
</includes> | ||
</fileSet> | ||
<fileSet filtered="true" encoding="UTF-8"> | ||
<directory>src/main/defaults</directory> | ||
<includes> | ||
<include>**/*.properties</include> | ||
</includes> | ||
</fileSet> | ||
<fileSet filtered="true" encoding="UTF-8"> | ||
<directory></directory> | ||
<includes> | ||
<include>**/*.md</include> | ||
</includes> | ||
</fileSet> | ||
<fileSet encoding="UTF-8"> | ||
<directory></directory> | ||
<includes> | ||
<include>LICENSE.txt</include> | ||
</includes> | ||
</fileSet> | ||
<fileSet filtered="true" encoding="UTF-8"> | ||
<directory>src/main/resources</directory> | ||
<includes> | ||
<include>**/org.dcache.pool.nearline.spi.NearlineStorageProvider</include> | ||
</includes> | ||
</fileSet> | ||
</fileSets> | ||
</archetype-descriptor> |
845 changes: 845 additions & 0 deletions
845
archetypes/dcache-nearline-plugin-archetype/target/classes/archetype-resources/LICENSE.txt
Large diffs are not rendered by default.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
...s/dcache-nearline-plugin-archetype/target/classes/archetype-resources/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Nearline Storage Plugin for dCache | ||
================================== | ||
|
||
This is nearline storage plugin for dCache. | ||
|
||
To compile the plugin, run: | ||
|
||
mvn package | ||
|
||
This produces a tarball in the `target` directory containing the plugin. | ||
|
||
Using the plugin with dCache | ||
---------------------------- | ||
|
||
To use this plugin with dCache, place the directory containing this | ||
file in /usr/local/share/dcache/plugins/ on a dCache pool. Restart | ||
the pool to load the plugin. | ||
|
||
To verify that the plugin is loaded, navigate to the pool in the dCache admin | ||
shell and issue the command: | ||
|
||
hsm show providers | ||
|
||
The plugin should be listed. | ||
|
||
To activate the plugin, create an HSM instance using: | ||
|
||
hsm create osm name ${name} [-key=value]... | ||
|
68 changes: 68 additions & 0 deletions
68
archetypes/dcache-nearline-plugin-archetype/target/classes/archetype-resources/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>${groupId}</groupId> | ||
<artifactId>${artifactId}</artifactId> | ||
<version>${version}</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>${description}</name> | ||
|
||
<properties> | ||
<version.dcache>${dcache}</version.dcache> | ||
</properties> | ||
|
||
<licenses> | ||
<license> | ||
<name>GNU Lesser General Public License 3</name> | ||
<url>http://www.gnu.org/licenses/lgpl-3.0.txt</url> | ||
<distribution>repo</distribution> | ||
</license> | ||
</licenses> | ||
|
||
<repositories> | ||
<repository> | ||
<id>dcache.repository</id> | ||
<url>https://download.dcache.org/nexus/content/groups/public</url> | ||
</repository> | ||
</repositories> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.dcache</groupId> | ||
<artifactId>dcache-nearline-spi</artifactId> | ||
<version>${version.dcache}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<version>2.6</version> | ||
<executions> | ||
<execution> | ||
<id>make-assembly</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>single</goal> | ||
</goals> | ||
<configuration> | ||
<descriptors> | ||
<descriptor>src/main/assembly/plugin.xml</descriptor> | ||
</descriptors> | ||
<appendAssemblyId>false</appendAssemblyId> | ||
<formats> | ||
<format>dir</format> | ||
<format>tar.gz</format> | ||
</formats> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
37 changes: 37 additions & 0 deletions
37
...nearline-plugin-archetype/target/classes/archetype-resources/src/main/assembly/plugin.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#set( $symbol_pound = '#' ) | ||
#set( $symbol_dollar = '$' ) | ||
#set( $symbol_escape = '\' ) | ||
<assembly> | ||
<id>tarball</id> | ||
<includeBaseDirectory>true</includeBaseDirectory> | ||
|
||
<dependencySets> | ||
<dependencySet> | ||
<excludes> | ||
<exclude>org.dcache:dcache-nearline-spi:*</exclude> | ||
</excludes> | ||
<useProjectArtifact>true</useProjectArtifact> | ||
<useTransitiveFiltering>true</useTransitiveFiltering> | ||
</dependencySet> | ||
</dependencySets> | ||
|
||
<fileSets> | ||
<fileSet> | ||
<includes> | ||
<include>LICENSE*</include> | ||
</includes> | ||
</fileSet> | ||
<fileSet> | ||
<directory>src/main/docs</directory> | ||
<outputDirectory></outputDirectory> | ||
<filtered>true</filtered> | ||
</fileSet> | ||
<fileSet> | ||
<directory>src/main/defaults</directory> | ||
<outputDirectory></outputDirectory> | ||
<includes> | ||
<include>*.properties</include> | ||
</includes> | ||
</fileSet> | ||
</fileSets> | ||
</assembly> |
5 changes: 5 additions & 0 deletions
5
...plugin-archetype/target/classes/archetype-resources/src/main/defaults/__name__.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#set( $symbol_pound = '#' ) | ||
#set( $symbol_dollar = '$' ) | ||
#set( $symbol_escape = '\' ) | ||
${symbol_pound} This Java properties file contains the default values used by | ||
${symbol_pound} the plugin. |
23 changes: 23 additions & 0 deletions
23
...ine-plugin-archetype/target/classes/archetype-resources/src/main/docs/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Nearline Storage Plugin for dCache | ||
================================== | ||
|
||
This is nearline storage plugin for dCache. | ||
|
||
Using the plugin with dCache | ||
---------------------------- | ||
|
||
To use this plugin with dCache, place the directory containing this | ||
file in /usr/local/share/dcache/plugins/ on a dCache pool. Restart | ||
the pool to load the plugin. | ||
|
||
To verify that the plugin is loaded, navigate to the pool in the dCache admin | ||
shell and issue the command: | ||
|
||
hsm show providers | ||
|
||
The plugin should be listed. | ||
|
||
To activate the plugin, create an HSM instance using: | ||
|
||
hsm create osm name ${name} [-key=value]... | ||
|
100 changes: 100 additions & 0 deletions
100
...gin-archetype/target/classes/archetype-resources/src/main/java/PluginNearlineStorage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#set( $symbol_pound = '#' ) | ||
#set( $symbol_dollar = '$' ) | ||
#set( $symbol_escape = '\' ) | ||
package ${package}; | ||
|
||
import java.util.Map; | ||
import java.util.UUID; | ||
|
||
import org.dcache.pool.nearline.spi.FlushRequest; | ||
import org.dcache.pool.nearline.spi.NearlineStorage; | ||
import org.dcache.pool.nearline.spi.RemoveRequest; | ||
import org.dcache.pool.nearline.spi.StageRequest; | ||
|
||
public class PluginNearlineStorage implements NearlineStorage | ||
{ | ||
protected final String type; | ||
protected final String name; | ||
|
||
public PluginNearlineStorage(String type, String name) | ||
{ | ||
this.type = type; | ||
this.name = name; | ||
} | ||
|
||
/** | ||
* Flush all files in {@code requests} to nearline storage. | ||
* | ||
* @param requests | ||
*/ | ||
@Override | ||
public void flush(Iterable<FlushRequest> requests) | ||
{ | ||
throw new UnsupportedOperationException("Not implemented"); | ||
} | ||
|
||
/** | ||
* Stage all files in {@code requests} from nearline storage. | ||
* | ||
* @param requests | ||
*/ | ||
@Override | ||
public void stage(Iterable<StageRequest> requests) | ||
{ | ||
throw new UnsupportedOperationException("Not implemented"); | ||
} | ||
|
||
/** | ||
* Delete all files in {@code requests} from nearline storage. | ||
* | ||
* @param requests | ||
*/ | ||
@Override | ||
public void remove(Iterable<RemoveRequest> requests) | ||
{ | ||
throw new UnsupportedOperationException("Not implemented"); | ||
} | ||
|
||
/** | ||
* Cancel any flush, stage or remove request with the given id. | ||
* <p> | ||
* The failed method of any cancelled request should be called with a | ||
* CancellationException. If the request completes before it can be | ||
* cancelled, then the cancellation should be ignored and the completed | ||
* or failed method should be called as appropriate. | ||
* <p> | ||
* A call to cancel must be non-blocking. | ||
* | ||
* @param uuid id of the request to cancel | ||
*/ | ||
@Override | ||
public void cancel(UUID uuid) | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Applies a new configuration. | ||
* | ||
* @param properties | ||
* @throws IllegalArgumentException if the configuration is invalid | ||
*/ | ||
@Override | ||
public void configure(Map<String, String> properties) throws IllegalArgumentException | ||
{ | ||
|
||
} | ||
|
||
/** | ||
* Cancels all requests and initiates a shutdown of the nearline storage | ||
* interface. | ||
* <p> | ||
* This method does not wait for actively executing requests to | ||
* terminate. | ||
*/ | ||
@Override | ||
public void shutdown() | ||
{ | ||
|
||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...etype/target/classes/archetype-resources/src/main/java/PluginNearlineStorageProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#set( $symbol_pound = '#' ) | ||
#set( $symbol_dollar = '$' ) | ||
#set( $symbol_escape = '\' ) | ||
package ${package}; | ||
|
||
import java.util.Properties; | ||
|
||
import org.dcache.pool.nearline.spi.NearlineStorage; | ||
import org.dcache.pool.nearline.spi.NearlineStorageProvider; | ||
|
||
public class PluginNearlineStorageProvider implements NearlineStorageProvider | ||
{ | ||
@Override | ||
public String getName() | ||
{ | ||
return "${name}"; | ||
} | ||
|
||
@Override | ||
public String getDescription() | ||
{ | ||
return "${description}"; | ||
} | ||
|
||
@Override | ||
public NearlineStorage createNearlineStorage(String type, String name) | ||
{ | ||
return new PluginNearlineStorage(type, name); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
...src/main/resources/META-INF/services/org.dcache.pool.nearline.spi.NearlineStorageProvider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
${package}.PluginNearlineStorageProvider |
7 changes: 7 additions & 0 deletions
7
.../dcache-nearline-plugin-archetype/target/test-classes/projects/basic/archetype.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package=org.dcache.it | ||
version=0.1-SNAPSHOT | ||
groupId=archetype.it | ||
artifactId=basic | ||
dcache=2.16.3 | ||
name=myplugin | ||
description=My plugin |
1 change: 1 addition & 0 deletions
1
archetypes/dcache-nearline-plugin-archetype/target/test-classes/projects/basic/goal.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package |
Oops, something went wrong.