Use SXSSFWorkbook in XlsExporter to improve memory usage when exporting xlsx files (#2594)
This commit is contained in:
parent
40336da2d5
commit
88f7fb2852
@ -253,12 +253,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi</artifactId>
|
<artifactId>poi</artifactId>
|
||||||
<version>4.1.1</version>
|
<version>4.1.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.poi</groupId>
|
<groupId>org.apache.poi</groupId>
|
||||||
<artifactId>poi-ooxml</artifactId>
|
<artifactId>poi-ooxml</artifactId>
|
||||||
<version>4.1.1</version>
|
<version>4.1.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.odftoolkit</groupId>
|
<groupId>org.odftoolkit</groupId>
|
||||||
|
@ -48,7 +48,7 @@ import org.apache.poi.ss.usermodel.Row;
|
|||||||
import org.apache.poi.ss.usermodel.Sheet;
|
import org.apache.poi.ss.usermodel.Sheet;
|
||||||
import org.apache.poi.ss.usermodel.Workbook;
|
import org.apache.poi.ss.usermodel.Workbook;
|
||||||
import org.apache.poi.ss.util.WorkbookUtil;
|
import org.apache.poi.ss.util.WorkbookUtil;
|
||||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.google.refine.ProjectManager;
|
import com.google.refine.ProjectManager;
|
||||||
@ -72,7 +72,7 @@ public class XlsExporter implements StreamExporter {
|
|||||||
public void export(final Project project, Properties params, Engine engine,
|
public void export(final Project project, Properties params, Engine engine,
|
||||||
OutputStream outputStream) throws IOException {
|
OutputStream outputStream) throws IOException {
|
||||||
|
|
||||||
final Workbook wb = xml ? new XSSFWorkbook() : new HSSFWorkbook();
|
final Workbook wb = xml ? new SXSSFWorkbook() : new HSSFWorkbook();
|
||||||
|
|
||||||
TabularSerializer serializer = new TabularSerializer() {
|
TabularSerializer serializer = new TabularSerializer() {
|
||||||
Sheet s;
|
Sheet s;
|
||||||
|
Loading…
Reference in New Issue
Block a user