16
16
*/
17
17
class Full extends \Magento \Catalog \Model \Indexer \Category \Product \AbstractAction
18
18
{
19
-
20
- /**
21
- * Row count to process in a batch
22
- */
23
- const DEFAULT_BATCH_SIZE = 100000 ;
24
-
25
19
/**
26
20
* @var \Magento\Framework\Indexer\BatchSizeManagementInterface
27
21
*/
@@ -47,7 +41,7 @@ class Full extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractActio
47
41
*
48
42
* @var int
49
43
*/
50
- private $ batchSize ;
44
+ private $ batchRowsCount ;
51
45
52
46
/**
53
47
* @param ResourceConnection $resource
@@ -58,7 +52,7 @@ class Full extends \Magento\Catalog\Model\Indexer\Category\Product\AbstractActio
58
52
* @param \Magento\Framework\Indexer\BatchProviderInterface|null $batchProvider
59
53
* @param \Magento\Framework\EntityManager\MetadataPool|null $metadataPool
60
54
* @param \Magento\Indexer\Model\Indexer\StateFactory|null $stateFactory
61
- * @param int|null $batchSize
55
+ * @param int|null $batchRowsCount
62
56
*/
63
57
public function __construct (
64
58
\Magento \Framework \App \ResourceConnection $ resource ,
@@ -69,7 +63,7 @@ public function __construct(
69
63
\Magento \Framework \Indexer \BatchProviderInterface $ batchProvider = null ,
70
64
\Magento \Framework \EntityManager \MetadataPool $ metadataPool = null ,
71
65
\Magento \Indexer \Model \Indexer \StateFactory $ stateFactory = null ,
72
- $ batchSize = null
66
+ $ batchRowsCount = null
73
67
) {
74
68
parent ::__construct (
75
69
$ resource ,
@@ -90,7 +84,7 @@ public function __construct(
90
84
$ this ->indexerStateFactory = $ stateFactory ?: $ objectManager ->get (
91
85
\Magento \Indexer \Model \Indexer \StateFactory::class
92
86
);
93
- $ this ->batchSize = $ batchSize ?: self :: DEFAULT_BATCH_SIZE ;
87
+ $ this ->batchRowsCount = $ batchRowsCount ;
94
88
}
95
89
96
90
/**
@@ -215,12 +209,12 @@ private function reindexCategoriesBySelect(\Magento\Framework\DB\Select $basicSe
215
209
{
216
210
$ entityMetadata = $ this ->metadataPool ->getMetadata (\Magento \Catalog \Api \Data \ProductInterface::class);
217
211
$ columns = array_keys ($ this ->connection ->describeTable ($ this ->getMainTmpTable ()));
218
- $ this ->batchSizeManagement ->ensureBatchSize ($ this ->connection , $ this ->batchSize );
212
+ $ this ->batchSizeManagement ->ensureBatchSize ($ this ->connection , $ this ->batchRowsCount );
219
213
$ batches = $ this ->batchProvider ->getBatches (
220
214
$ this ->connection ,
221
215
$ entityMetadata ->getEntityTable (),
222
216
$ entityMetadata ->getIdentifierField (),
223
- $ this ->batchSize
217
+ $ this ->batchRowsCount
224
218
);
225
219
foreach ($ batches as $ batch ) {
226
220
$ this ->clearTmpData ();
0 commit comments