File tree Expand file tree Collapse file tree 5 files changed +60
-22
lines changed
app/code/Magento/CatalogInventory
Model/ResourceModel/Indexer/Stock
lib/internal/Magento/Framework/Indexer Expand file tree Collapse file tree 5 files changed +60
-22
lines changed Original file line number Diff line number Diff line change @@ -404,9 +404,6 @@ private function getQueryProcessorComposite()
404
404
405
405
/**
406
406
* @inheritdoc
407
- * Returns main table name based on the suffix stored in the 'indexer_state' table
408
- *
409
- * @return string
410
407
*/
411
408
public function getMainTable ()
412
409
{
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 88
88
</type >
89
89
<virtualType name =" Magento\CatalogInventory\Model\Indexer\Stock\BatchSizeManagement" type =" Magento\Framework\Indexer\BatchSizeManagement" >
90
90
<arguments >
91
- <argument name =" rowSizeEstimator" xsi : type =" object" shared =" false" >Magento\CatalogInventory\Model\ResourceModel\Indexer\Stock\IndexTableRowSizeEstimator</argument >
91
+ <argument name =" rowSizeEstimator" xsi : type =" object" >Magento\CatalogInventory\Model\ResourceModel\Indexer\Stock\IndexTableRowSizeEstimator</argument >
92
+ </arguments >
93
+ </virtualType >
94
+ <virtualType name =" Magento\CatalogInventory\Model\ResourceModel\Indexer\Stock\IndexTableRowSizeEstimator" type =" Magento\Framework\Indexer\IndexTableRowSizeEstimator" >
95
+ <arguments >
96
+ <argument name =" rowMemorySize" xsi : type =" number" >100</argument >
92
97
</arguments >
93
98
</virtualType >
94
99
<type name =" Magento\CatalogInventory\Model\Indexer\Stock\Action\Full" >
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2013-2017 Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ namespace Magento \Framework \Indexer ;
8
+
9
+ /**
10
+ * Generic implementation for row size estimation.
11
+ */
12
+ class IndexTableRowSizeEstimator implements IndexTableRowSizeEstimatorInterface
13
+ {
14
+ /**
15
+ * @var int
16
+ */
17
+ private $ rowMemorySize ;
18
+
19
+ /**
20
+ * @param int $rowMemorySize
21
+ */
22
+ public function __construct ($ rowMemorySize )
23
+ {
24
+ $ this ->rowMemorySize = $ rowMemorySize ;
25
+ }
26
+
27
+ /**
28
+ * @inheritdoc
29
+ */
30
+ public function estimateRowSize ()
31
+ {
32
+ return $ this ->rowMemorySize ;
33
+ }
34
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © 2013-2017 Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+
7
+ namespace Magento \Framework \Indexer \Test \Unit ;
8
+
9
+ class IndexTableRowSizeEstimatorTest extends \PHPUnit_Framework_TestCase
10
+ {
11
+ /**
12
+ * Test for estimateRowSize method
13
+ */
14
+ public function testEstimateRowSize ()
15
+ {
16
+ $ rowMemorySize = 100 ;
17
+ $ model = new \Magento \Framework \Indexer \IndexTableRowSizeEstimator ($ rowMemorySize );
18
+ $ this ->assertEquals ($ model ->estimateRowSize (), $ rowMemorySize );
19
+ }
20
+ }
You can’t perform that action at this time.
0 commit comments