Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Madan Jampani
2014-11-12 00:54:18 -0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
23af4fc06579efb931a36c445a8bea2638b5fa8a
23af4fc0
1 parent
39460b80
Fixed checkstyle issues
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
29 additions
and
3 deletions
core/api/src/main/java/org/onlab/onos/store/service/BatchReadRequest.java
core/api/src/main/java/org/onlab/onos/store/service/BatchReadResult.java
core/api/src/main/java/org/onlab/onos/store/service/BatchWriteRequest.java
core/api/src/main/java/org/onlab/onos/store/service/BatchWriteResult.java
core/api/src/main/java/org/onlab/onos/store/service/DatabaseService.java
core/api/src/main/java/org/onlab/onos/store/service/Lock.java
core/api/src/main/java/org/onlab/onos/store/service/ReadResult.java
core/api/src/main/java/org/onlab/onos/store/service/ReadStatus.java
core/api/src/main/java/org/onlab/onos/store/service/WriteResult.java
core/api/src/main/java/org/onlab/onos/store/service/WriteStatus.java
core/api/src/main/java/org/onlab/onos/store/service/BatchReadRequest.java
View file @
23af4fc
...
...
@@ -8,7 +8,7 @@ import com.google.common.collect.Lists;
/**
* Collection of read requests to be submitted as one batch.
*/
public
class
BatchReadRequest
{
public
final
class
BatchReadRequest
{
private
final
List
<
ReadRequest
>
readRequests
;
...
...
@@ -60,7 +60,7 @@ public class BatchReadRequest {
}
/**
* Builds a BatchReadRequest
* Builds a BatchReadRequest.
* @return BatchReadRequest
*/
public
BatchReadRequest
build
()
{
...
...
core/api/src/main/java/org/onlab/onos/store/service/BatchReadResult.java
View file @
23af4fc
...
...
@@ -3,6 +3,9 @@ package org.onlab.onos.store.service;
import
java.util.Collections
;
import
java.util.List
;
/**
* Result of a batch read operation.
*/
public
class
BatchReadResult
{
private
final
List
<
ReadResult
>
readResults
;
...
...
@@ -11,10 +14,18 @@ public class BatchReadResult {
this
.
readResults
=
Collections
.
unmodifiableList
(
readResults
);
}
/**
* Returns the results as a list.
* @return list of results
*/
public
List
<
ReadResult
>
getAsList
()
{
return
readResults
;
}
/**
* Returns the batch size.
* @return batch size
*/
public
int
batchSize
()
{
return
readResults
.
size
();
}
...
...
core/api/src/main/java/org/onlab/onos/store/service/BatchWriteRequest.java
View file @
23af4fc
...
...
@@ -8,7 +8,7 @@ import com.google.common.collect.Lists;
/**
* Collection of write requests to be submitted as one batch.
*/
public
class
BatchWriteRequest
{
public
final
class
BatchWriteRequest
{
private
final
List
<
WriteRequest
>
writeRequests
;
...
...
core/api/src/main/java/org/onlab/onos/store/service/BatchWriteResult.java
View file @
23af4fc
...
...
@@ -3,6 +3,9 @@ package org.onlab.onos.store.service;
import
java.util.Collections
;
import
java.util.List
;
/**
* Result of a batch write operation.
*/
public
class
BatchWriteResult
{
private
final
List
<
WriteResult
>
writeResults
;
...
...
@@ -11,6 +14,10 @@ public class BatchWriteResult {
this
.
writeResults
=
Collections
.
unmodifiableList
(
writeResults
);
}
/**
* Returns true if this batch write operation was successful.
* @return true if successful, false otherwise.
*/
public
boolean
isSuccessful
()
{
for
(
WriteResult
result
:
writeResults
)
{
if
(
result
.
status
()
!=
WriteStatus
.
OK
)
{
...
...
@@ -20,10 +27,18 @@ public class BatchWriteResult {
return
true
;
}
/**
* Returns the results as a List.
* @return list of batch results.
*/
public
List
<
WriteResult
>
getAsList
()
{
return
this
.
writeResults
;
}
/**
* Returns the size of this batch.
* @return batch size.
*/
public
int
batchSize
()
{
return
writeResults
.
size
();
}
...
...
core/api/src/main/java/org/onlab/onos/store/service/DatabaseService.java
View file @
23af4fc
core/api/src/main/java/org/onlab/onos/store/service/Lock.java
View file @
23af4fc
core/api/src/main/java/org/onlab/onos/store/service/ReadResult.java
View file @
23af4fc
core/api/src/main/java/org/onlab/onos/store/service/ReadStatus.java
View file @
23af4fc
core/api/src/main/java/org/onlab/onos/store/service/WriteResult.java
View file @
23af4fc
core/api/src/main/java/org/onlab/onos/store/service/WriteStatus.java
View file @
23af4fc
Please
register
or
login
to post a comment