mbien commented on code in PR #5655:
URL: https://github.com/apache/netbeans/pull/5655#discussion_r1134645245
##########
java/maven.indexer/src/org/netbeans/modules/maven/indexer/NexusRepositoryIndexerImpl.java:
##########
@@ -585,45 +594,33 @@ private void indexLoadedRepo(final RepositoryInfo repo,
boolean updateLocal) thr
}
}
}
- } catch (IOException e) {
+ } catch (IOException e) {
if(e.getCause() instanceof ResourceDoesNotExistException) {
fireChange(repo, () -> repo.fireNoIndex());
}
- File tmpFolder = Places.getCacheDirectory();
- // see also issue #250365
- String noSpaceLeftMsg = null;
- if(e.getMessage() != null && e.getMessage().contains("No space
left on device")) {
- noSpaceLeftMsg =
Bundle.MSG_NoSpace(tmpFolder.getAbsolutePath(), repo.getName());
- }
-
- long downloaded = listener != null ? listener.getUnits() * 1024 :
-1;
- long usableSpace = -1;
- try {
- FileStore store = Files.getFileStore(tmpFolder.toPath());
- usableSpace = store.getUsableSpace();
- } catch (IOException ex) {
- Exceptions.printStackTrace(ex);
- }
- LOGGER.log(Level.INFO, "Downloaded maven index file has size {0}
(zipped). The usable space in {1} is {2}.", new Object[]{downloaded, tmpFolder,
usableSpace});
+ Path tmpFolder = Paths.get(System.getProperty("java.io.tmpdir"));
Review Comment:
yes, this is right now only half of the implementation. Since we don't
control the location of the gz itself yet. This is for the larger part: the
extracted temp index, before it is moved to cache - so it does help a bit.
if we find a way to get this in: #4999 we then have almost full control over
it. The last remaining part would be to fix a bug in maven-indexer which
currently hardcodes the extraction of silo files to tmp - but this does also
require 4999, since we use a EOL indexer lib now without a way to get fixes in.
Once everything is in place we could make it configurable in the UI. As
workaround: users can probably start nb by overriding the tmp folder:
`-J-Djava.io.tmpdir=/path/to/tmpdir`
I am also in contact with maven devs via slack since I have some ideas how
to potentially significantly shrink index size. (wouldn't it be nice to drop
all artifacts which are older than x years and make this configurable in the
UI? Some artifacts also copy their whole doc into the description field which
we could probably drop too. However, this is all blocked by JDK 8, I don't want
to work too much ahead when a simple veto can put that time into waste)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists