cloudsim-plus-master/cloudsim-plus-master/cloudsim-plus/src/main/java/org/cloudbus/cloudsim/datacenters/DatacenterSimple.java
protected void processDataAdd(final SimEvent ev, final boolean ack) {
        if (Objects.isNull(ev)) {
            return;
        }

        final Object[] pack = (Object[]) ev.getData();
        if (Objects.isNull(pack)) {
            return;
        }

        final File file = (File) pack[0]; // get the file
        file.setMasterCopy(true); // set the file into a master copy
        final int sentFrom = (Integer) pack[1]; // get sender ID

        final Object[] data = new Object[3];
        data[0] = file.getName();

        final int msg = addFile(file); // add the file

        if (ack) {
            data[1] = -1; // no sender id
            data[2] = msg; // the result of adding a master file
            sendNow(sentFrom, DataCloudTags.MASTERFILE_ADD_RESULT, data);
        }
    }
/**
     * Process a file inclusion request.
     *
     * @param ev information about the event just happened
     * @param ack indicates if the event's sender expects to receive an
     * acknowledge message when the event finishes to be processed
     */
Process a file inclusion request.
@param ev information about the event just happened
@param ack indicates if the event's sender expects to receive an
acknowledge message when the event finishes to be processed
Process a file inclusion request . @param ev information about the event just happened @param ack indicates if the event ' s sender expects to receive an acknowledge message when the event finishes to be processed
protected void processDataAdd(final SimEvent ev, final boolean ack) {
        if (Objects.isNull(ev)) {
            return;
        }
        final Object[] pack = (Object[]) ev.getData();
        if (Objects.isNull(pack)) {
            return;
        }
        final File file = (File) pack[0]; 
        file.setMasterCopy(true); 
        final int sentFrom = (Integer) pack[1]; 
        final Object[] data = new Object[3];
        data[0] = file.getName();
        final int msg = addFile(file); 
        if (ack) {
            data[1] = -1; 
            data[2] = msg; 
            sendNow(sentFrom, DataCloudTags.MASTERFILE_ADD_RESULT, data);
        }
    }
protected void processDataAdd ( final SimEvent ev , final boolean ack ) { if ( Objects . isNull ( ev ) ) { return ; } final Object [ ] pack = ( Object [ ] ) ev . getData ( ) ; if ( Objects . isNull ( pack ) ) { return ; } final File file = ( File ) pack [ 0 ] ; file . setMasterCopy ( true ) ; final int sentFrom = ( Integer ) pack [ 1 ] ; final Object [ ] data = new Object [ 3 ] ; data [ 0 ] = file . getName ( ) ; final int msg = addFile ( file ) ; if ( ack ) { data [ 1 ] = - 1 ; data [ 2 ] = msg ; sendNow ( sentFrom , DataCloudTags . MASTERFILE_ADD_RESULT , data ) ; } }
Process a file inclusion request.
Process a file inclusion request .
// get the file // set the file into a master copy // get sender ID // add the file // no sender id // the result of adding a master file