Move cache serializers to dedicated subpackage
Change-Id: Ia6a9814529ed958ee76202cf9e299ad04d7922fc
This commit is contained in:
		| @@ -20,6 +20,7 @@ import com.google.common.cache.LoadingCache; | ||||
| import com.google.common.cache.Weigher; | ||||
| import com.google.gerrit.extensions.annotations.Exports; | ||||
| import com.google.gerrit.extensions.config.FactoryModule; | ||||
| import com.google.gerrit.server.cache.serialize.JavaCacheSerializer; | ||||
| import com.google.inject.Key; | ||||
| import com.google.inject.Provider; | ||||
| import com.google.inject.Scopes; | ||||
|   | ||||
| @@ -16,6 +16,7 @@ package com.google.gerrit.server.cache; | ||||
|  | ||||
| import com.google.common.cache.CacheLoader; | ||||
| import com.google.common.cache.Weigher; | ||||
| import com.google.gerrit.server.cache.serialize.CacheSerializer; | ||||
| import java.time.Duration; | ||||
|  | ||||
| /** Configure a persistent cache declared within a {@link CacheModule} instance. */ | ||||
|   | ||||
| @@ -14,6 +14,8 @@ | ||||
|  | ||||
| package com.google.gerrit.server.cache; | ||||
|  | ||||
| import com.google.gerrit.server.cache.serialize.CacheSerializer; | ||||
|  | ||||
| public interface PersistentCacheDef<K, V> extends CacheDef<K, V> { | ||||
|   long diskLimit(); | ||||
|  | ||||
|   | ||||
| @@ -20,6 +20,8 @@ import com.google.common.cache.Cache; | ||||
| import com.google.common.cache.CacheLoader; | ||||
| import com.google.common.cache.Weigher; | ||||
| import com.google.gerrit.common.Nullable; | ||||
| import com.google.gerrit.server.cache.serialize.CacheSerializer; | ||||
| import com.google.gerrit.server.cache.serialize.JavaCacheSerializer; | ||||
| import com.google.inject.Inject; | ||||
| import com.google.inject.Provider; | ||||
| import com.google.inject.TypeLiteral; | ||||
|   | ||||
							
								
								
									
										1
									
								
								java/com/google/gerrit/server/cache/h2/BUILD
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								java/com/google/gerrit/server/cache/h2/BUILD
									
									
									
									
										vendored
									
									
								
							| @@ -8,6 +8,7 @@ java_library( | ||||
|         "//java/com/google/gerrit/extensions:api", | ||||
|         "//java/com/google/gerrit/lifecycle", | ||||
|         "//java/com/google/gerrit/server", | ||||
|         "//java/com/google/gerrit/server/cache/serialize", | ||||
|         "//lib:guava", | ||||
|         "//lib:h2", | ||||
|         "//lib/flogger:api", | ||||
|   | ||||
| @@ -17,9 +17,9 @@ package com.google.gerrit.server.cache.h2; | ||||
| import com.google.common.cache.CacheLoader; | ||||
| import com.google.common.cache.Weigher; | ||||
| import com.google.gerrit.common.Nullable; | ||||
| import com.google.gerrit.server.cache.CacheSerializer; | ||||
| import com.google.gerrit.server.cache.PersistentCacheDef; | ||||
| import com.google.gerrit.server.cache.h2.H2CacheImpl.ValueHolder; | ||||
| import com.google.gerrit.server.cache.serialize.CacheSerializer; | ||||
| import com.google.inject.TypeLiteral; | ||||
| import java.time.Duration; | ||||
|  | ||||
|   | ||||
| @@ -25,8 +25,8 @@ import com.google.common.flogger.FluentLogger; | ||||
| import com.google.common.hash.BloomFilter; | ||||
| import com.google.gerrit.common.Nullable; | ||||
| import com.google.gerrit.common.TimeUtil; | ||||
| import com.google.gerrit.server.cache.CacheSerializer; | ||||
| import com.google.gerrit.server.cache.PersistentCache; | ||||
| import com.google.gerrit.server.cache.serialize.CacheSerializer; | ||||
| import com.google.inject.TypeLiteral; | ||||
| import java.io.IOException; | ||||
| import java.io.InvalidClassException; | ||||
|   | ||||
| @@ -17,7 +17,7 @@ package com.google.gerrit.server.cache.h2; | ||||
| import com.google.common.hash.Funnel; | ||||
| import com.google.common.hash.Funnels; | ||||
| import com.google.common.hash.PrimitiveSink; | ||||
| import com.google.gerrit.server.cache.CacheSerializer; | ||||
| import com.google.gerrit.server.cache.serialize.CacheSerializer; | ||||
| import java.io.IOException; | ||||
| import java.sql.PreparedStatement; | ||||
| import java.sql.ResultSet; | ||||
|   | ||||
							
								
								
									
										12
									
								
								java/com/google/gerrit/server/cache/serialize/BUILD
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								java/com/google/gerrit/server/cache/serialize/BUILD
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| java_library( | ||||
|     name = "serialize", | ||||
|     srcs = glob(["*.java"]), | ||||
|     visibility = ["//visibility:public"], | ||||
|     deps = [ | ||||
|         "//java/com/google/gerrit/common:annotations", | ||||
|         "//lib:guava", | ||||
|         "//lib:gwtorm", | ||||
|         "//lib:protobuf", | ||||
|         "//lib/jgit/org.eclipse.jgit:jgit", | ||||
|     ], | ||||
| ) | ||||
| @@ -12,7 +12,7 @@ | ||||
| // See the License for the specific language governing permissions and | ||||
| // limitations under the License. | ||||
| 
 | ||||
| package com.google.gerrit.server.cache; | ||||
| package com.google.gerrit.server.cache.serialize; | ||||
| 
 | ||||
| import static com.google.common.base.Preconditions.checkNotNull; | ||||
| import static java.nio.charset.StandardCharsets.UTF_8; | ||||
| @@ -12,7 +12,7 @@ | ||||
| // See the License for the specific language governing permissions and | ||||
| // limitations under the License. | ||||
| 
 | ||||
| package com.google.gerrit.server.cache; | ||||
| package com.google.gerrit.server.cache.serialize; | ||||
| 
 | ||||
| /** | ||||
|  * Interface for serializing/deserializing a type to/from a persistent cache. | ||||
| @@ -12,7 +12,7 @@ | ||||
| // See the License for the specific language governing permissions and | ||||
| // limitations under the License. | ||||
| 
 | ||||
| package com.google.gerrit.server.cache; | ||||
| package com.google.gerrit.server.cache.serialize; | ||||
| 
 | ||||
| import static com.google.common.base.Preconditions.checkNotNull; | ||||
| import static java.nio.charset.StandardCharsets.UTF_8; | ||||
| @@ -12,7 +12,7 @@ | ||||
| // See the License for the specific language governing permissions and | ||||
| // limitations under the License. | ||||
| 
 | ||||
| package com.google.gerrit.server.cache; | ||||
| package com.google.gerrit.server.cache.serialize; | ||||
| 
 | ||||
| import static com.google.common.base.Preconditions.checkNotNull; | ||||
| 
 | ||||
| @@ -12,7 +12,7 @@ | ||||
| // See the License for the specific language governing permissions and | ||||
| // limitations under the License. | ||||
| 
 | ||||
| package com.google.gerrit.server.cache; | ||||
| package com.google.gerrit.server.cache.serialize; | ||||
| 
 | ||||
| import static com.google.common.base.Preconditions.checkNotNull; | ||||
| 
 | ||||
| @@ -12,7 +12,7 @@ | ||||
| // See the License for the specific language governing permissions and | ||||
| // limitations under the License. | ||||
| 
 | ||||
| package com.google.gerrit.server.cache; | ||||
| package com.google.gerrit.server.cache.serialize; | ||||
| 
 | ||||
| import com.google.gerrit.common.Nullable; | ||||
| import java.io.ByteArrayInputStream; | ||||
| @@ -12,7 +12,7 @@ | ||||
| // See the License for the specific language governing permissions and | ||||
| // limitations under the License. | ||||
| 
 | ||||
| package com.google.gerrit.server.cache; | ||||
| package com.google.gerrit.server.cache.serialize; | ||||
| 
 | ||||
| import static com.google.common.base.Preconditions.checkArgument; | ||||
| import static org.eclipse.jgit.lib.Constants.OBJECT_ID_LENGTH; | ||||
| @@ -12,7 +12,7 @@ | ||||
| // See the License for the specific language governing permissions and | ||||
| // limitations under the License. | ||||
| 
 | ||||
| package com.google.gerrit.server.cache; | ||||
| package com.google.gerrit.server.cache.serialize; | ||||
| 
 | ||||
| import static java.nio.charset.StandardCharsets.UTF_8; | ||||
| 
 | ||||
| @@ -5,6 +5,7 @@ java_library( | ||||
|     srcs = glob(["*.java"]), | ||||
|     visibility = ["//visibility:public"], | ||||
|     deps = [ | ||||
|         "//java/com/google/gerrit/server/cache/serialize", | ||||
|         "//lib:guava", | ||||
|         "//lib:protobuf", | ||||
|         "//lib/commons:lang3", | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Dave Borowitz
					Dave Borowitz