1 /***********************************************************************
2  * Copyright (c) 2013-2025 General Atomics Integrated Intelligence, Inc.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Apache License, Version 2.0
5  * which accompanies this distribution and is available at
6  * https://www.apache.org/licenses/LICENSE-2.0
7  ***********************************************************************/
8 
9 package org.locationtech.geomesa.redis.tools.schema
10 
11 import com.beust.jcommander.Parameters
12 import org.locationtech.geomesa.redis.data.RedisDataStore
13 import org.locationtech.geomesa.redis.tools.RedisDataStoreCommand
14 import org.locationtech.geomesa.redis.tools.RedisDataStoreCommand.RedisDataStoreParams
15 import org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand._
16 import org.locationtech.geomesa.tools.data.ManagePartitionsCommand
17 import org.locationtech.geomesa.tools.data.ManagePartitionsCommand._
18 import org.locationtech.geomesa.tools.{OptionalForceParam, RequiredTypeNameParam}
19 
20 class RedisManagePartitionsCommand extends ManagePartitionsCommand {
21   override protected def list: RedisListPartitionsCommand = new RedisListPartitionsCommand
22   override protected def add: RedisAddPartitionsCommand = new RedisAddPartitionsCommand
23   override protected def adopt: RedisAdoptPartitionCommand = new RedisAdoptPartitionCommand
24   override protected def delete: RedisDeletePartitionsCommand = new RedisDeletePartitionsCommand
25   override protected def generate: RedisNamePartitionsCommand = new RedisNamePartitionsCommand
26 }
27 
28 object RedisManagePartitionsCommand  {
29 
30   class RedisListPartitionsCommand extends RedisDataStoreCommand with ListPartitionsCommand[RedisDataStore] {
31     override val params: RedisListPartitionsParams = new RedisListPartitionsParams
32   }
33 
34   class RedisAddPartitionsCommand extends RedisDataStoreCommand with AddPartitionsCommand[RedisDataStore] {
35     override val params: RedisAddPartitionsParams = new RedisAddPartitionsParams
36   }
37 
38   class RedisAdoptPartitionCommand extends RedisDataStoreCommand with AdoptPartitionCommand[RedisDataStore] {
39     override val params: RedisAdoptPartitionParams = new RedisAdoptPartitionParams
40   }
41 
42   class RedisDeletePartitionsCommand extends RedisDataStoreCommand with DeletePartitionsCommand[RedisDataStore] {
43     override val params: RedisDeletePartitionsParams = new RedisDeletePartitionsParams
44   }
45 
46   class RedisNamePartitionsCommand extends RedisDataStoreCommand with NamePartitionsCommand[RedisDataStore] {
47     override val params: RedisNamePartitionsParams = new RedisNamePartitionsParams
48   }
49 
50   @Parameters(commandDescription = "List the current partitions for a GeoMesa schema")
51   class RedisListPartitionsParams extends RedisDataStoreParams with RequiredTypeNameParam
52 
53   @Parameters(commandDescription = "Configure new partitions for a GeoMesa schema")
54   class RedisAddPartitionsParams extends RedisDataStoreParams with PartitionsParam
55 
56   @Parameters(commandDescription = "Adopt existing tables as a new partition for a GeoMesa schema")
57   class RedisAdoptPartitionParams extends RedisDataStoreParams with AdoptPartitionParam
58 
59   @Parameters(commandDescription = "Delete existing partitions for a GeoMesa schema")
60   class RedisDeletePartitionsParams extends RedisDataStoreParams with PartitionsParam with OptionalForceParam
61 
62   @Parameters(commandDescription = "Generate partition names from input values")
63   class RedisNamePartitionsParams extends RedisDataStoreParams with NamePartitionsParam
64 }
Line Stmt Id Pos Tree Symbol Tests Code
21 99920 1201 - 1231 Apply org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand.RedisListPartitionsCommand.<init> new org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand.RedisListPartitionsCommand()
22 99921 1290 - 1319 Apply org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand.RedisAddPartitionsCommand.<init> new org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand.RedisAddPartitionsCommand()
23 99922 1381 - 1411 Apply org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand.RedisAdoptPartitionCommand.<init> new org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand.RedisAdoptPartitionCommand()
24 99923 1476 - 1508 Apply org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand.RedisDeletePartitionsCommand.<init> new org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand.RedisDeletePartitionsCommand()
25 99924 1573 - 1603 Apply org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand.RedisNamePartitionsCommand.<init> new org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand.RedisNamePartitionsCommand()
31 99925 1810 - 1839 Apply org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand.RedisListPartitionsParams.<init> new RedisManagePartitionsCommand.this.RedisListPartitionsParams()
35 99926 2005 - 2033 Apply org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand.RedisAddPartitionsParams.<init> new RedisManagePartitionsCommand.this.RedisAddPartitionsParams()
39 99927 2202 - 2231 Apply org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand.RedisAdoptPartitionParams.<init> new RedisManagePartitionsCommand.this.RedisAdoptPartitionParams()
43 99928 2406 - 2437 Apply org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand.RedisDeletePartitionsParams.<init> new RedisManagePartitionsCommand.this.RedisDeletePartitionsParams()
47 99929 2606 - 2635 Apply org.locationtech.geomesa.redis.tools.schema.RedisManagePartitionsCommand.RedisNamePartitionsParams.<init> new RedisManagePartitionsCommand.this.RedisNamePartitionsParams()