Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Michael Ritter
chronopolis-core
Commits
c56f6167
Commit
c56f6167
authored
Jan 21, 2016
by
Michael Ritter
Browse files
Merge branch 'hotfix-distributions-1.1.1'
parents
ad2fe4aa
5f753f89
Changes
15
Hide whitespace changes
Inline
Side-by-side
amqp-core/pom.xml
View file @
c56f6167
...
...
@@ -5,7 +5,7 @@
<parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
chronopolis
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
</parent>
<packaging>
jar
</packaging>
...
...
chron-db/pom.xml
View file @
c56f6167
...
...
@@ -6,11 +6,11 @@
<parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
chronopolis
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
</parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
chron-db
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
<dependencies>
...
...
common/pom.xml
View file @
c56f6167
...
...
@@ -5,12 +5,12 @@
<parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
chronopolis
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
</parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
chron-common
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
<name>
Common
</name>
<url>
http://maven.apache.org
</url>
<properties>
...
...
duracloud-backend/pom.xml
View file @
c56f6167
...
...
@@ -7,12 +7,12 @@
<parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
chronopolis
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
</parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
duracloud-backend
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
<build>
<plugins>
...
...
duracloud-intake/pom.xml
View file @
c56f6167
...
...
@@ -7,12 +7,12 @@
<parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
chronopolis
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
</parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
duracloud-intake
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
<build>
<plugins>
...
...
ingest-rest/pom.xml
View file @
c56f6167
...
...
@@ -7,12 +7,12 @@
<parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
chronopolis
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
</parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
ingest-rest
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
<build>
<plugins>
...
...
ingest-rest/src/main/java/org/chronopolis/ingest/BagInitializer.java
View file @
c56f6167
...
...
@@ -42,18 +42,21 @@ public class BagInitializer {
@Autowired
public
BagInitializer
(
NodeRepository
repository
,
IngestSettings
settings
)
{
this
.
settings
=
settings
;
this
.
repository
=
repository
;
BagInitializer
.
settings
=
settings
;
BagInitializer
.
repository
=
repository
;
}
/**
* Iterate through a list of node usernames and add them to the BagDistribution table
* TODO: Should we make distribution records for all nodes if the request is empty/null
* TODO: List<String> -> List<Node> for replicating nodes
* TODO: Use replicatingNodes size as number of required replications? (implicit association)
*
* @param bag
* @param replicatingNodes
*/
private
static
void
createBagDistributions
(
Bag
bag
,
List
<
String
>
replicatingNodes
)
{
int
numDistributions
=
0
;
if
(
replicatingNodes
==
null
)
{
replicatingNodes
=
new
ArrayList
<>();
}
...
...
@@ -63,10 +66,20 @@ public class BagInitializer {
if
(
node
!=
null
)
{
log
.
debug
(
"Creating dist record for {}"
,
nodeName
);
bag
.
addDistribution
(
node
,
DISTRIBUTE
);
numDistributions
++;
}
}
if
(
numDistributions
<
bag
.
getRequiredReplications
())
{
for
(
Node
node
:
repository
.
findAll
())
{
log
.
debug
(
"Creating dist record for {}"
,
node
.
getUsername
());
bag
.
addDistribution
(
node
,
DISTRIBUTE
);
numDistributions
++;
}
}
}
/**
* Set the location, fixity value, size, and total number of files for the bag
*
...
...
@@ -101,7 +114,11 @@ public class BagInitializer {
bag
.
setSize
(
bagSize
[
0
]);
bag
.
setTotalFiles
(
fileCount
[
0
]);
bag
.
setFixityAlgorithm
(
"SHA-256"
);
bag
.
setRequiredReplications
(
request
.
getRequiredReplications
());
// could put this in the bag object...
if
(
request
.
getRequiredReplications
()
>
0
)
{
bag
.
setRequiredReplications
(
request
.
getRequiredReplications
());
}
createBagDistributions
(
bag
,
request
.
getReplicatingNodes
());
}
...
...
ingest-rest/src/main/java/org/chronopolis/ingest/repository/ReplicationService.java
View file @
c56f6167
...
...
@@ -4,6 +4,7 @@ import com.mysema.query.types.expr.BooleanExpression;
import
org.chronopolis.ingest.IngestSettings
;
import
org.chronopolis.ingest.exception.NotFoundException
;
import
org.chronopolis.rest.models.Bag
;
import
org.chronopolis.rest.models.BagDistribution
;
import
org.chronopolis.rest.models.Node
;
import
org.chronopolis.rest.models.Replication
;
import
org.chronopolis.rest.models.ReplicationRequest
;
...
...
@@ -20,8 +21,10 @@ import javax.transaction.Transactional;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.util.Map
;
import
java.util.Set
;
import
static
org
.
chronopolis
.
ingest
.
repository
.
PredicateUtil
.
setExpression
;
import
static
org
.
chronopolis
.
rest
.
models
.
BagDistribution
.
BagDistributionStatus
.
DISTRIBUTE
;
/**
* Class to help querying for replication objects based on various values.
...
...
@@ -94,6 +97,21 @@ public class ReplicationService {
throw
new
NotFoundException
(
"Bag "
+
request
.
getBagId
());
}
// create a dist object if it's missing
BagDistribution
bagDistribution
=
null
;
Set
<
BagDistribution
>
distributions
=
bag
.
getDistributions
();
for
(
BagDistribution
distribution
:
distributions
)
{
if
(
distribution
.
getNode
().
equals
(
node
))
{
bagDistribution
=
distribution
;
}
}
if
(
bagDistribution
==
null
)
{
bag
.
addDistribution
(
node
,
DISTRIBUTE
);
// not sure if this is the best place for this...
bagRepository
.
save
(
bag
);
}
// vars to help create replication stuff
final
String
user
=
settings
.
getReplicationUser
();
final
String
server
=
settings
.
getStorageServer
();
...
...
ingest-rest/src/test/java/org/chronopolis/ingest/api/StagingControllerTest.java
View file @
c56f6167
...
...
@@ -119,6 +119,7 @@ public class StagingControllerTest extends IngestTest {
request
.
setDepositor
(
"test-depositor"
);
request
.
setLocation
(
"test-depositor/new-bag-1"
);
request
.
setReplicatingNodes
(
ImmutableList
.
of
(
"umiacs"
));
request
.
setRequiredReplications
(
1
);
ResponseEntity
<
Bag
>
bag
=
template
.
postForEntity
(
"http://localhost:"
+
port
+
"/api/bags"
,
...
...
ingest-shell/pom.xml
View file @
c56f6167
...
...
@@ -5,11 +5,11 @@
<parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
chronopolis
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
</parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
ingest-shell
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
<packaging>
jar
</packaging>
<name>
Ingest Shell
</name>
<url>
http://maven.apache.org
</url>
...
...
intake-shell/pom.xml
View file @
c56f6167
...
...
@@ -5,11 +5,11 @@
<parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
chronopolis
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
</parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
intake-shell
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
<packaging>
jar
</packaging>
<name>
Intake Shell
</name>
<url>
https://chron-git.umiacs.umd.edu/chron-core/
</url>
...
...
messaging/pom.xml
View file @
c56f6167
...
...
@@ -6,7 +6,7 @@
<parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
chronopolis
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
</parent>
<packaging>
jar
</packaging>
...
...
pom.xml
View file @
c56f6167
...
...
@@ -10,7 +10,7 @@
<groupId>
org.chronopolis
</groupId>
<artifactId>
chronopolis
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
<packaging>
pom
</packaging>
<name>
Core Chronopolis
</name>
...
...
replication-shell/pom.xml
View file @
c56f6167
...
...
@@ -5,10 +5,10 @@
<parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
chronopolis
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
</parent>
<artifactId>
replication-shell
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
<name>
Replication Shell
</name>
<url>
http://maven.apache.org
</url>
<properties>
...
...
rest-common/pom.xml
View file @
c56f6167
...
...
@@ -6,12 +6,12 @@
<groupId>
org.chronopolis
</groupId>
<artifactId>
rest-common
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
<parent>
<groupId>
org.chronopolis
</groupId>
<artifactId>
chronopolis
</artifactId>
<version>
1.1.
0
-RELEASE
</version>
<version>
1.1.
1
-RELEASE
</version>
</parent>
<dependencies>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment