Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
2928a312
Commit
2928a312
authored
May 31, 2017
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.5.x'
parents
0296ff6b
c22230a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
RandomAccessDataFile.java
...pringframework/boot/loader/data/RandomAccessDataFile.java
+7
-4
No files found.
spring-boot-tools/spring-boot-loader/src/main/java/org/springframework/boot/loader/data/RandomAccessDataFile.java
View file @
2928a312
...
@@ -67,7 +67,7 @@ public class RandomAccessDataFile implements RandomAccessData {
...
@@ -67,7 +67,7 @@ public class RandomAccessDataFile implements RandomAccessData {
throw
new
IllegalArgumentException
(
"File must exist"
);
throw
new
IllegalArgumentException
(
"File must exist"
);
}
}
this
.
file
=
file
;
this
.
file
=
file
;
this
.
filePool
=
new
FilePool
(
concurrentReads
);
this
.
filePool
=
new
FilePool
(
file
,
concurrentReads
);
this
.
offset
=
0L
;
this
.
offset
=
0L
;
this
.
length
=
file
.
length
();
this
.
length
=
file
.
length
();
}
}
...
@@ -229,7 +229,9 @@ public class RandomAccessDataFile implements RandomAccessData {
...
@@ -229,7 +229,9 @@ public class RandomAccessDataFile implements RandomAccessData {
* Manage a pool that can be used to perform concurrent reads on the underlying
* Manage a pool that can be used to perform concurrent reads on the underlying
* {@link RandomAccessFile}.
* {@link RandomAccessFile}.
*/
*/
class
FilePool
{
static
class
FilePool
{
private
final
File
file
;
private
final
int
size
;
private
final
int
size
;
...
@@ -237,7 +239,8 @@ public class RandomAccessDataFile implements RandomAccessData {
...
@@ -237,7 +239,8 @@ public class RandomAccessDataFile implements RandomAccessData {
private
final
Queue
<
RandomAccessFile
>
files
;
private
final
Queue
<
RandomAccessFile
>
files
;
FilePool
(
int
size
)
{
FilePool
(
File
file
,
int
size
)
{
this
.
file
=
file
;
this
.
size
=
size
;
this
.
size
=
size
;
this
.
available
=
new
Semaphore
(
size
);
this
.
available
=
new
Semaphore
(
size
);
this
.
files
=
new
ConcurrentLinkedQueue
<>();
this
.
files
=
new
ConcurrentLinkedQueue
<>();
...
@@ -249,7 +252,7 @@ public class RandomAccessDataFile implements RandomAccessData {
...
@@ -249,7 +252,7 @@ public class RandomAccessDataFile implements RandomAccessData {
if
(
file
!=
null
)
{
if
(
file
!=
null
)
{
return
file
;
return
file
;
}
}
return
new
RandomAccessFile
(
RandomAccessDataFile
.
this
.
file
,
"r"
);
return
new
RandomAccessFile
(
this
.
file
,
"r"
);
}
}
public
void
release
(
RandomAccessFile
file
)
{
public
void
release
(
RandomAccessFile
file
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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