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

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

        final String filename = (String) data[0];
        final int reqSource = (Integer) data[1];
        int tag;

        // check if this file can be deleted (do not delete is right now)
        final int msg = deleteFileFromStorage(filename);
        if (msg == DataCloudTags.FILE_DELETE_SUCCESSFUL) {
            tag = DataCloudTags.CTLG_DELETE_MASTER;
        } else { // if an error occured, notify user
            tag = DataCloudTags.FILE_DELETE_MASTER_RESULT;
        }

        if (ack) {
            // send back to sender
            Object pack[] = new Object[2];
            pack[0] = filename;
            pack[1] = msg;

            sendNow(reqSource, tag, pack);
        }
    }
/**
     * Process a file deletion 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 deletion 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 deletion 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 processDataDelete(final SimEvent ev, final boolean ack) {
        if (Objects.isNull(ev)) {
            return;
        }
        final Object[] data = (Object[]) ev.getData();
        if (Objects.isNull(data)) {
            return;
        }
        final String filename = (String) data[0];
        final int reqSource = (Integer) data[1];
        int tag;
        final int msg = deleteFileFromStorage(filename);
        if (msg == DataCloudTags.FILE_DELETE_SUCCESSFUL) {
            tag = DataCloudTags.CTLG_DELETE_MASTER;
        } else { 
            tag = DataCloudTags.FILE_DELETE_MASTER_RESULT;
        }
        if (ack) {
            Object pack[] = new Object[2];
            pack[0] = filename;
            pack[1] = msg;
            sendNow(reqSource, tag, pack);
        }
    }
protected void processDataDelete ( final SimEvent ev , final boolean ack ) { if ( Objects . isNull ( ev ) ) { return ; } final Object [ ] data = ( Object [ ] ) ev . getData ( ) ; if ( Objects . isNull ( data ) ) { return ; } final String filename = ( String ) data [ 0 ] ; final int reqSource = ( Integer ) data [ 1 ] ; int tag ; final int msg = deleteFileFromStorage ( filename ) ; if ( msg == DataCloudTags . FILE_DELETE_SUCCESSFUL ) { tag = DataCloudTags . CTLG_DELETE_MASTER ; } else { tag = DataCloudTags . FILE_DELETE_MASTER_RESULT ; } if ( ack ) { Object pack [ ] = new Object [ 2 ] ; pack [ 0 ] = filename ; pack [ 1 ] = msg ; sendNow ( reqSource , tag , pack ) ; } }
Process a file deletion request.
Process a file deletion request .
// check if this file can be deleted (do not delete is right now) // if an error occured, notify user // send back to sender