[core] IDEA-320380: lower huge Gists limit down to 50KiB

- Gists larger 50KiB are now stored in dedicated files in a `<caches>/huge-gists/<fs-timestamp>` folder
- Use `-Didea.gist.max-size-to-store-in-attributes` to change the limit: value -1 effectively disables huge Gists store in files, and returns previous behavior, there all the Gists are stored in the VFS attributes.

GitOrigin-RevId: 3f9eb1cce31bb6c94095c3e3f007427b09a45348
This commit is contained in:
Ruslan Cheremin
2023-05-19 10:28:48 +02:00
committed by intellij-monorepo-bot
parent 2151f07cc4
commit 6bd795de83

View File

@@ -47,6 +47,7 @@ import java.util.Map;
import java.util.function.Supplier;
import static com.intellij.util.SystemProperties.getIntProperty;
import static com.intellij.util.io.IOUtil.KiB;
import static java.nio.file.StandardOpenOption.*;
class VirtualFileGistImpl<Data> implements VirtualFileGist<Data> {
@@ -57,7 +58,7 @@ class VirtualFileGistImpl<Data> implements VirtualFileGist<Data> {
* If == 0: store all gists in VFS attributes.
* Value should be <= {@link com.intellij.openapi.vfs.newvfs.persistent.AbstractAttributesStorage#MAX_ATTRIBUTE_VALUE_SIZE}
*/
public static final int MAX_GIST_SIZE_TO_STORE_IN_ATTRIBUTES = getIntProperty("idea.gist.max-size-to-store-in-attributes", Integer.MAX_VALUE /*goal: 50 * KiB*/);
public static final int MAX_GIST_SIZE_TO_STORE_IN_ATTRIBUTES = getIntProperty("idea.gist.max-size-to-store-in-attributes", 50 * KiB);
private static final String HUGE_GISTS_DIR_NAME = "huge-gists";