package com.a.eye.skywalking.storage.data.file;

import com.a.eye.skywalking.storage.data.spandata.SpanData;
import com.a.eye.skywalking.storage.data.index.IndexMetaCollection;

import java.util.List;

public class DataFileWriter {

    private DataFile dataFile;

    public DataFileWriter() {
        dataFile = DataFilesManager.createNewDataFile();
    }

    public IndexMetaCollection write(List<SpanData> spanData) {
        if (dataFile.overLimitLength()) {
            this.close();
            dataFile = DataFilesManager.createNewDataFile();
        }

        IndexMetaCollection collections = new IndexMetaCollection();
        for (SpanData data : spanData) {
            collections.add(dataFile.write(data));
        }

        return collections;
    }

    public void flush(){
        dataFile.flush();
    }

    public void close(){
        dataFile.close();
    }
}

@@ -740,59 +740,26 @@
     
-return collections;%0A    %7D%0A%0A    public void 
+dataFile.
 flush()
-%7B
+;%0A
 %0A   
@@ -763,32 +763,34 @@
         
-dataFile.flush()
+return collections
 ;%0A    %7D%0A

fix flush missing