Package org.sonar.plugins.python.caching
Class Caching
- java.lang.Object
-
- org.sonar.plugins.python.caching.Caching
-
public class Caching extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringCACHE_VERSION_KEYStringcacheVersionstatic StringCONTENT_HASHES_KEYstatic StringCPD_TOKENS_CACHE_KEY_PREFIXstatic StringCPD_TOKENS_STRING_TABLE_KEY_PREFIXstatic StringIMPORTS_MAP_CACHE_KEY_PREFIXstatic StringPROJECT_FILES_KEYstatic StringPROJECT_SYMBOL_TABLE_CACHE_KEY_PREFIXstatic StringTYPESHED_MODULES_KEY
-
Constructor Summary
Constructors Constructor Description Caching(CacheContext cacheContext, String cacheVersion)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CacheContextcacheContext()voidcopyFromPrevious(String fileKey)static StringfileContentHashCacheKey(String key)static StringimportsMapCacheKey(String key)booleanisCacheEnabled()booleanisCacheVersionUpToDate()static StringprojectSymbolTableCacheKey(String key)byte[]readFileContentHash(String fileKey)Set<String>readFilesList()Set<String>readImportMapEntry(String fileKey)Set<Descriptor>readProjectLevelSymbolTableEntry(String fileKey)Set<String>readTypeshedModules()voidwriteCacheVersion()voidwriteFileContentHash(String fileKey, byte[] hash)voidwriteFilesList(List<String> mainFiles)voidwriteImportsMapEntry(String fileKey, Set<String> imports)voidwriteProjectLevelSymbolTableEntry(String fileKey, Set<Descriptor> descriptors)voidwriteTypeshedModules(Set<String> stubModules)
-
-
-
Field Detail
-
IMPORTS_MAP_CACHE_KEY_PREFIX
public static final String IMPORTS_MAP_CACHE_KEY_PREFIX
- See Also:
- Constant Field Values
-
PROJECT_SYMBOL_TABLE_CACHE_KEY_PREFIX
public static final String PROJECT_SYMBOL_TABLE_CACHE_KEY_PREFIX
- See Also:
- Constant Field Values
-
PROJECT_FILES_KEY
public static final String PROJECT_FILES_KEY
- See Also:
- Constant Field Values
-
CONTENT_HASHES_KEY
public static final String CONTENT_HASHES_KEY
- See Also:
- Constant Field Values
-
TYPESHED_MODULES_KEY
public static final String TYPESHED_MODULES_KEY
- See Also:
- Constant Field Values
-
CACHE_VERSION_KEY
public static final String CACHE_VERSION_KEY
- See Also:
- Constant Field Values
-
CPD_TOKENS_CACHE_KEY_PREFIX
public static final String CPD_TOKENS_CACHE_KEY_PREFIX
- See Also:
- Constant Field Values
-
CPD_TOKENS_STRING_TABLE_KEY_PREFIX
public static final String CPD_TOKENS_STRING_TABLE_KEY_PREFIX
- See Also:
- Constant Field Values
-
cacheVersion
public final String cacheVersion
-
-
Constructor Detail
-
Caching
public Caching(CacheContext cacheContext, String cacheVersion)
-
-
Method Detail
-
writeFileContentHash
public void writeFileContentHash(String fileKey, byte[] hash)
-
writeCacheVersion
public void writeCacheVersion()
-
writeProjectLevelSymbolTableEntry
public void writeProjectLevelSymbolTableEntry(String fileKey, Set<Descriptor> descriptors)
-
copyFromPrevious
public void copyFromPrevious(String fileKey)
-
readProjectLevelSymbolTableEntry
@CheckForNull public Set<Descriptor> readProjectLevelSymbolTableEntry(String fileKey)
-
readFileContentHash
public byte[] readFileContentHash(String fileKey)
-
isCacheVersionUpToDate
public boolean isCacheVersionUpToDate()
-
isCacheEnabled
public boolean isCacheEnabled()
-
cacheContext
public CacheContext cacheContext()
-
-