Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
swh-graph
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Platform
Development
swh-graph
Merge requests
!405
Add StoredFcl2DumpedFcl.java
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Add StoredFcl2DumpedFcl.java
upgrade-fcl
into
master
Overview
5
Commits
2
Pipelines
3
Changes
2
Closed
vlorentz
requested to merge
upgrade-fcl
into
master
1 year ago
Overview
5
Commits
2
Pipelines
3
Changes
2
Expand
This allows upgrading old graphs to be readable by the current versions, both Java and Rust
Edited
1 year ago
by
vlorentz
0
0
Merge request reports
Compare
master
version 2
109c4529
1 year ago
version 1
5aa95167
1 year ago
master (base)
and
latest version
latest version
d2800400
2 commits,
11 months ago
version 2
109c4529
1 commit,
1 year ago
version 1
5aa95167
1 commit,
1 year ago
2 files
+
53
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
java/src/main/java/org/softwareheritage/graph/utils/StoredFcl2DumpedFcl.java
0 → 100644
+
47
−
0
Options
/*
* Copyright (c) 2024 The Software Heritage developers
* See the AUTHORS file at the top-level directory of this distribution
* License: GNU General Public License version 3, or any later version
* See top-level LICENSE file for more information
*/
package
org.softwareheritage.graph.utils
;
import
com.martiansoftware.jsap.*
;
import
com.martiansoftware.jsap.stringparsers.*
;
import
it.unimi.dsi.big.util.FrontCodedStringBigList
;
import
it.unimi.dsi.fastutil.io.BinIO
;
import
org.apache.commons.configuration2.ex.ConfigurationException
;
import
java.io.IOException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
public
class
StoredFcl2DumpedFcl
{
public
static
void
main
(
final
String
[]
arg
)
throws
JSAPException
,
IOException
,
ConfigurationException
,
ClassNotFoundException
{
final
SimpleJSAP
jsap
=
new
SimpleJSAP
(
StoredFcl2DumpedFcl
.
class
.
getName
(),
"Reads a .fcl file and produces .fcl.bytearray, .fcl.pointers, and .fcl.properties file which can be mmapped"
,
new
Parameter
[]{
new
FlaggedOption
(
"ratio"
,
IntSizeStringParser
.
getParser
(),
"4"
,
JSAP
.
NOT_REQUIRED
,
'r'
,
"ratio"
,
"The compression ratio."
),
new
UnflaggedOption
(
"basename"
,
JSAP
.
STRING_PARSER
,
JSAP
.
NO_DEFAULT
,
JSAP
.
REQUIRED
,
JSAP
.
NOT_GREEDY
,
"The basename of the files associated with the memory-mapped front-coded string list."
)});
final
JSAPResult
args
=
jsap
.
parse
(
arg
);
if
(
jsap
.
messagePrinted
())
return
;
final
String
basename
=
args
.
getString
(
"basename"
);
final
Logger
logger
=
LoggerFactory
.
getLogger
(
StoredFcl2DumpedFcl
.
class
);
logger
.
info
(
"Reading front-coded string big list..."
);
final
FrontCodedStringBigList
nonutf8Fcl
=
(
FrontCodedStringBigList
)
BinIO
.
loadObject
(
System
.
in
);
final
FrontCodedStringBigList
utf8Fcl
=
new
FrontCodedStringBigList
(
nonutf8Fcl
,
args
.
getInt
(
"ratio"
),
true
);
logger
.
info
(
"Dumping files..."
);
utf8Fcl
.
dump
(
basename
);
}
}
Loading