github.com/m3db/m3@v1.5.0/src/dbnode/generated-source-files.mk (about)

     1  SELF_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
     2  include $(SELF_DIR)/../../.ci/common.mk
     3  
     4  gopath_prefix        := $(GOPATH)/src
     5  m3db_package         := github.com/m3db/m3
     6  m3db_package_path    := $(gopath_prefix)/$(m3db_package)
     7  m3x_package          := github.com/m3db/m3/src/x
     8  m3x_package_path     := $(gopath_prefix)/$(m3x_package)
     9  
    10  # Generation rule for all generated types
    11  .PHONY: genny-all
    12  genny-all: genny-map-all genny-arraypool-all genny-leakcheckpool-all genny-list-all
    13  
    14  # Map generation rule for all generated maps
    15  .PHONY: genny-map-all
    16  genny-map-all:                                         \
    17  	genny-map-client-received-blocks                   \
    18  	genny-map-storage-block-retriever                  \
    19  	genny-map-storage-bootstrap-namespaces             \
    20  	genny-map-storage-bootstrap-namespace-results      \
    21  	genny-map-storage-bootstrap-result                 \
    22  	genny-map-storage                                  \
    23  	genny-map-storage-namespace-metadata               \
    24  	genny-map-storage-repair                           \
    25  	genny-map-storage-index-results                    \
    26  	genny-map-storage-index-aggregate-values           \
    27  	genny-map-storage-index-aggregation-results        \
    28  
    29  # Map generation rule for client/receivedBlocksMap
    30  .PHONY: genny-map-client-received-blocks
    31  genny-map-client-received-blocks:
    32  	cd $(m3x_package_path) && make hashmap-gen         \
    33  		pkg=client                                       \
    34  		key_type=idAndBlockStart                         \
    35  		value_type=receivedBlocks                        \
    36  		target_package=$(m3db_package)/src/dbnode/client \
    37  		rename_type_prefix=receivedBlocks
    38  	# Rename generated map file
    39  	mv -f $(m3db_package_path)/src/dbnode/client/map_gen.go $(m3db_package_path)/src/dbnode/client/received_blocks_map_gen.go
    40  
    41  # Map generation rule for storage/block/retrieverMap
    42  .PHONY: genny-map-storage-block-retriever
    43  genny-map-storage-block-retriever:
    44  	cd $(m3x_package_path) && make idhashmap-gen              \
    45  		pkg=block                                               \
    46  		value_type=DatabaseBlockRetriever                       \
    47  		target_package=$(m3db_package)/src/dbnode/storage/block \
    48  		rename_type_prefix=retriever                            \
    49  		rename_constructor=newRetrieverMap                      \
    50  		rename_constructor_options=retrieverMapOptions
    51  	# Rename both generated map and constructor files
    52  	mv -f $(m3db_package_path)/src/dbnode/storage/block/map_gen.go $(m3db_package_path)/src/dbnode/storage/block/retriever_map_gen.go
    53  	mv -f $(m3db_package_path)/src/dbnode/storage/block/new_map_gen.go $(m3db_package_path)/src/dbnode/storage/block/retriever_new_map_gen.go
    54  
    55  # Map generation rule for storage/bootstrap/NamespacesMap
    56  .PHONY: genny-map-storage-bootstrap-namespaces
    57  genny-map-storage-bootstrap-namespaces:
    58  	cd $(m3x_package_path) && make idhashmap-gen                    \
    59  		pkg=bootstrap                                               \
    60  		value_type=Namespace                                        \
    61  		target_package=$(m3db_package)/src/dbnode/storage/bootstrap \
    62  		rename_type_prefix=Namespaces                               \
    63  		rename_constructor=NewNamespacesMap                         \
    64  		rename_constructor_options=NamespacesMapOptions
    65  	# Rename both generated map and constructor files
    66  	mv -f $(m3db_package_path)/src/dbnode/storage/bootstrap/map_gen.go $(m3db_package_path)/src/dbnode/storage/bootstrap/namespaces_map_gen.go
    67  	mv -f $(m3db_package_path)/src/dbnode/storage/bootstrap/new_map_gen.go $(m3db_package_path)/src/dbnode/storage/bootstrap/namespaces_new_map_gen.go
    68  
    69  # Map generation rule for storage/bootstrap/NamespaceResultsMap
    70  .PHONY: genny-map-storage-bootstrap-namespace-results
    71  genny-map-storage-bootstrap-namespace-results:
    72  	cd $(m3x_package_path) && make idhashmap-gen                    \
    73  		pkg=bootstrap                                               \
    74  		value_type=NamespaceResult                                  \
    75  		target_package=$(m3db_package)/src/dbnode/storage/bootstrap \
    76  		rename_type_prefix=NamespaceResults                         \
    77  		rename_constructor=NewNamespaceResultsMap                   \
    78  		rename_constructor_options=NamespaceResultsMapOptions
    79  	# Rename both generated map and constructor files
    80  	mv -f $(m3db_package_path)/src/dbnode/storage/bootstrap/map_gen.go $(m3db_package_path)/src/dbnode/storage/bootstrap/namespace_results_map_gen.go
    81  	mv -f $(m3db_package_path)/src/dbnode/storage/bootstrap/new_map_gen.go $(m3db_package_path)/src/dbnode/storage/bootstrap/namespace_results_new_map_gen.go
    82  
    83  # Map generation rule for storage/bootstrap/result/Map
    84  .PHONY: genny-map-storage-bootstrap-result
    85  genny-map-storage-bootstrap-result:
    86  	cd $(m3x_package_path) && make idhashmap-gen              \
    87  		pkg=result                                              \
    88  		value_type=DatabaseSeriesBlocks                         \
    89  		target_package=$(m3db_package)/src/dbnode/storage/bootstrap/result
    90  
    91  # Map generation rule for storage package maps (to avoid double build over each other
    92  # when generating map source files in parallel, run these sequentially)
    93  .PHONY: genny-map-storage
    94  genny-map-storage:                      \
    95  	genny-map-storage-shard             \
    96  	genny-map-storage-dirty-series      \
    97  
    98  # Map generation rule for storage/shardMap
    99  .PHONY: genny-map-storage-shard
   100  genny-map-storage-shard:
   101  	cd $(m3x_package_path) && make idhashmap-gen        \
   102  		pkg=storage                                       \
   103  		value_type=shardListElement                       \
   104  		target_package=$(m3db_package)/src/dbnode/storage \
   105  		rename_type_prefix=shard                          \
   106  		rename_constructor=newShardMap                    \
   107  		rename_constructor_options=shardMapOptions
   108  	# Rename both generated map and constructor files
   109  	mv -f $(m3db_package_path)/src/dbnode/storage/map_gen.go $(m3db_package_path)/src/dbnode/storage/shard_map_gen.go
   110  	mv -f $(m3db_package_path)/src/dbnode/storage/new_map_gen.go $(m3db_package_path)/src/dbnode/storage/shard_new_map_gen.go
   111  
   112  # Map generation rule for storage/namespace/metadataMap
   113  .PHONY: genny-map-storage-namespace-metadata
   114  genny-map-storage-namespace-metadata:
   115  	cd $(m3x_package_path) && make idhashmap-gen                  \
   116  		pkg=namespace                                               \
   117  		value_type=Metadata                                         \
   118  		target_package=$(m3db_package)/src/dbnode/namespace \
   119  		rename_type_prefix=metadata                                 \
   120  		rename_constructor=newMetadataMap                           \
   121  		rename_constructor_options=metadataMapOptions
   122  	# Rename both generated map and constructor files
   123  	mv -f $(m3db_package_path)/src/dbnode/namespace/map_gen.go $(m3db_package_path)/src/dbnode/namespace/metadata_map_gen.go
   124  	mv -f $(m3db_package_path)/src/dbnode/namespace/new_map_gen.go $(m3db_package_path)/src/dbnode/namespace/metadata_new_map_gen.go
   125  
   126  # Map generation rule for storage/repair/Map
   127  .PHONY: genny-map-storage-repair
   128  genny-map-storage-repair:
   129  	cd $(m3x_package_path) && make idhashmap-gen    \
   130  		pkg=repair                                    \
   131  		value_type=ReplicaSeriesBlocksMetadata        \
   132  		target_package=$(m3db_package)/src/dbnode/storage/repair
   133  
   134  # Map generation rule for persist/fs
   135  .PHONY: genny-map-persist-fs
   136  genny-map-persist-fs:
   137  	cd $(m3x_package_path) && make idhashmap-gen                 \
   138  		pkg=fs                                                   \
   139  		value_type=checked.Bytes                                 \
   140  		target_package=$(m3db_package)/src/dbnode/persist/fs     \
   141  		rename_constructor=newCheckedBytesByIDMap                \
   142  		rename_constructor_options=newCheckedBytesByIDMapOptions \
   143  		rename_type_prefix=checkedBytes                          \
   144  		rename_nogen_value=true
   145  	# Rename both generated map and constructor files
   146  	mv -f $(m3db_package_path)/src/dbnode/persist/fs/map_gen.go $(m3db_package_path)/src/dbnode/persist/fs/checked_bytes_by_id_map_gen.go
   147  	mv -f $(m3db_package_path)/src/dbnode/persist/fs/new_map_gen.go $(m3db_package_path)/src/dbnode/persist/fs/checked_bytes_by_id_new_map_gen.go
   148  
   149  # Map generation rule for storage/index/ResultsMap
   150  .PHONY: genny-map-storage-index-results
   151  genny-map-storage-index-results:
   152  	cd $(m3x_package_path) && make byteshashmap-gen             \
   153  		pkg=index                                               \
   154  		value_type=doc.Document                        \
   155  		target_package=$(m3db_package)/src/dbnode/storage/index \
   156  		rename_nogen_key=true                                   \
   157  		rename_nogen_value=true                                 \
   158  		rename_type_prefix=Results
   159  	# Rename generated map file
   160  	mv -f $(m3db_package_path)/src/dbnode/storage/index/map_gen.go $(m3db_package_path)/src/dbnode/storage/index/results_map_gen.go
   161  
   162  # Map generation rule for storage/index/AggregateValuesMap
   163  .PHONY: genny-map-storage-index-aggregate-values
   164  genny-map-storage-index-aggregate-values:
   165  	cd $(m3x_package_path) && make hashmap-gen \
   166  		pkg=index                                \
   167  		key_type=ident.ID                        \
   168  		value_type=struct{}                      \
   169  		rename_type_prefix=AggregateValues       \
   170  		rename_nogen_key=true                    \
   171  		rename_nogen_value=true                  \
   172  		target_package=$(m3db_package)/src/dbnode/storage/index
   173  	# Rename generated map file
   174  	mv -f $(m3db_package_path)/src/dbnode/storage/index/map_gen.go $(m3db_package_path)/src/dbnode/storage/index/aggregate_values_map_gen.go
   175  
   176  # Map generation rule for storage/index/AggregateResultsMap
   177  .PHONY: genny-map-storage-index-aggregation-results
   178  genny-map-storage-index-aggregation-results: genny-map-storage-index-aggregate-values
   179  	cd $(m3x_package_path) && make idhashmap-gen  \
   180  		pkg=index                                   \
   181  		value_type=AggregateValues                  \
   182  		rename_type_prefix=AggregateResults         \
   183  		target_package=$(m3db_package)/src/dbnode/storage/index
   184  	# Rename generated map file
   185  	mv -f $(m3db_package_path)/src/dbnode/storage/index/map_gen.go $(m3db_package_path)/src/dbnode/storage/index/aggregate_results_map_gen.go
   186  	# This map has a custom constructor; delete the genny generated one
   187  	rm -f $(m3db_package_path)/src/dbnode/storage/index/new_map_gen.go
   188  
   189  # Map generation rule for storage/DirtySeriesMap
   190  .PHONY: genny-map-storage-dirty-series
   191  genny-map-storage-dirty-series:
   192  	cd $(m3x_package_path) && make hashmap-gen            \
   193  		pkg=storage                                       \
   194  		key_type=idAndBlockStart                          \
   195  		value_type=*idElement                             \
   196  		value_type_alias=idElement                        \
   197  		target_package=$(m3db_package)/src/dbnode/storage \
   198  		rename_type_prefix=dirtySeries
   199  	# Rename both generated map and constructor files
   200  	mv -f $(m3db_package_path)/src/dbnode/storage/map_gen.go $(m3db_package_path)/src/dbnode/storage/dirty_series_map_gen.go
   201  	# This map has a custom constructor; delete the genny generated one
   202  	rm -f $(m3db_package_path)/src/dbnode/storage/new_map_gen.go
   203  
   204  # Generation rule for all generated arraypools
   205  .PHONY: genny-arraypool-all
   206  genny-arraypool-all:                      \
   207  	genny-arraypool-node-segments           \
   208  	genny-arraypool-aggregate-results-entry \
   209  
   210  # arraypool generation rule for ./network/server/tchannelthrift/node/segmentsArrayPool
   211  .PHONY: genny-arraypool-node-segments
   212  genny-arraypool-node-segments:
   213  	cd $(m3x_package_path) && make genny-arraypool                               \
   214  	pkg=node                                                                     \
   215  	elem_type=*rpc.Segments                                                      \
   216  	target_package=$(m3db_package)/src/dbnode/network/server/tchannelthrift/node \
   217  	out_file=segments_arraypool_gen.go                                           \
   218  	rename_type_prefix=segments                                                  \
   219  	rename_type_middle=Segments                                                  \
   220  	rename_constructor=newSegmentsArrayPool
   221  
   222  # arraypool generation rule for ./storage/index/AggregateResultsEntryArrayPool
   223  .PHONY: genny-arraypool-aggregate-results-entry
   224  genny-arraypool-aggregate-results-entry:
   225  	cd $(m3x_package_path) && make genny-arraypool          \
   226  	pkg=index                                               \
   227  	elem_type=AggregateResultsEntry                         \
   228  	target_package=$(m3db_package)/src/dbnode/storage/index \
   229  	out_file=aggregate_results_entry_arraypool_gen.go       \
   230  	rename_type_prefix=AggregateResultsEntry                \
   231  	rename_type_middle=AggregateResultsEntry                \
   232  	rename_constructor=NewAggregateResultsEntryArrayPool    \
   233  	rename_gen_types=true                                   \
   234  
   235  # generation rule for all generated leakcheckpools
   236  .PHONY: genny-leakcheckpool-all
   237  genny-leakcheckpool-all:                   \
   238  	genny-leakcheckpool-fetch-tagged-attempt \
   239  	genny-leakcheckpool-fetch-state          \
   240  	genny-leakcheckpool-fetch-tagged-op      \
   241  	genny-leakcheckpool-aggregate-attempt    \
   242  	genny-leakcheckpool-aggregate-op
   243  
   244  # leakcheckpool generation rule for ./client/fetchTaggedAttemptPool
   245  .PHONY: genny-leakcheckpool-fetch-tagged-attempt
   246  genny-leakcheckpool-fetch-tagged-attempt:
   247  	cd $(m3x_package_path) && make genny-leakcheckpool      \
   248  	pkg=client                                              \
   249  	elem_type=*fetchTaggedAttempt                           \
   250  	elem_type_pool=fetchTaggedAttemptPool                   \
   251  	target_package=$(m3db_package)/src/dbnode/client        \
   252  	out_file=fetch_tagged_attempt_leakcheckpool_gen_test.go
   253  
   254  # leakcheckpool generation rule for ./client/fetchStatePool
   255  .PHONY: genny-leakcheckpool-fetch-state
   256  genny-leakcheckpool-fetch-state:
   257  	cd $(m3x_package_path) && make genny-leakcheckpool \
   258  	pkg=client                                         \
   259  	elem_type=*fetchState                              \
   260  	elem_type_pool=fetchStatePool                      \
   261  	target_package=$(m3db_package)/src/dbnode/client   \
   262  	out_file=fetch_state_leakcheckpool_gen_test.go
   263  
   264  # leakcheckpool generation rule for ./client/fetchTaggedOp
   265  .PHONY: genny-leakcheckpool-fetch-tagged-op
   266  genny-leakcheckpool-fetch-tagged-op:
   267  	cd $(m3x_package_path) && make genny-leakcheckpool  \
   268  	pkg=client                                          \
   269  	elem_type=*fetchTaggedOp                            \
   270  	elem_type_pool=fetchTaggedOpPool                    \
   271  	target_package=$(m3db_package)/src/dbnode/client    \
   272  	out_file=fetch_tagged_op_leakcheckpool_gen_test.go
   273  
   274  # leakcheckpool generation rule for ./client/aggregateOp
   275  .PHONY: genny-leakcheckpool-aggregate-op
   276  genny-leakcheckpool-aggregate-op:
   277  	cd $(m3x_package_path) && make genny-leakcheckpool  \
   278  	pkg=client                                          \
   279  	elem_type=*aggregateOp                              \
   280  	elem_type_pool=aggregateOpPool                      \
   281  	target_package=$(m3db_package)/src/dbnode/client    \
   282  	out_file=aggregate_leakcheckpool_gen_test.go
   283  
   284  # leakcheckpool generation rule for ./client/aggregateAttemptPool
   285  .PHONY: genny-leakcheckpool-aggregate-attempt
   286  genny-leakcheckpool-aggregate-attempt:
   287  	cd $(m3x_package_path) && make genny-leakcheckpool      \
   288  	pkg=client                                              \
   289  	elem_type=*aggregateAttempt                             \
   290  	elem_type_pool=aggregateAttemptPool                     \
   291  	target_package=$(m3db_package)/src/dbnode/client        \
   292  	out_file=aggregate_attempt_leakcheckpool_gen_test.go
   293  
   294  # Generation rule for all generated lists
   295  .PHONY: genny-list-all
   296  genny-list-all:                              \
   297  	genny-list-storage-id
   298  
   299  # List generation rule for storage/idList
   300  .PHONY: genny-list-storage-id
   301  genny-list-storage-id:
   302  	cd $(m3x_package_path) && make genny-pooled-elem-list-gen \
   303  		pkg=storage                                           \
   304  		value_type=doc.Metadata                               \
   305  		rename_type_prefix=id                                 \
   306  		rename_type_middle=ID                                 \
   307  		target_package=github.com/m3db/m3/src/dbnode/storage
   308  	# Rename generated list file
   309  	mv -f $(m3db_package_path)/src/dbnode/storage/list_gen.go $(m3db_package_path)/src/dbnode/storage/id_list_gen.go