Исследование влияния фрагментации носителя на производительность файловой системы

Заказать уникальную курсовую работу
Тип работы: Курсовая работа
Предмет: Программирование
  • 29 29 страниц
  • 5 + 5 источников
  • Добавлена 14.07.2023
1 000 руб.
  • Содержание
  • Часть работы
  • Список литературы
1.Постановка задачи 2
2.Средства разработки 3
3.Функциональное описание программы 4
4.Структуры данных 6
5.Руководство пользователя 7
Заключение 8
Список литературы 9
Приложение 10

Фрагмент для ознакомления

nextLong()%blockcount; while(pos.contains(v)){ v = random.nextLong()%blockcount; } pos.add(v); } for(var blockidx : pos){ long idx = (long)blockidx; raf.seek(idx*block_size); raf.read(bytes); } break; } } }}MainForm.javapackage com.mycompany.defrag_analysis;import java.io.File;import java.util.ArrayList;import java.util.Calendar;import java.util.List;import java.util.concurrent.ExecutionException;import javax.swing.SwingWorker;public class MainForm extends javax.swing.JFrame { /** * Creates new form MainForm */ public MainForm() { initComponents();/* this.jComboBoxDisks.addItem("C"); this.jComboBoxDisks.addItem("D"); this.jComboBoxDisks.addItem("E"); this.jComboBoxDisks.addItem("F"); this.jComboBoxAMethod.addItem("прямой"); this.jComboBoxAMethod.addItem("обратный"); this.jComboBoxAMethod.addItem("случайный");*/ } class MSwingWorker extends SwingWorker { public String path; public int blocksize1; public FileReadMethod method; public void setParams(FileReadMethod method, String p, int blocksize) { this.method = method; this.path = p; this.blocksize1 = blocksize; } @Override protected Boolean doInBackground() throws Exception { throw new UnsupportedOperationException("Not supported yet."); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/GeneratedMethodBody } } private void jButtonStartActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: MSwingWorker worker = new MSwingWorker() { long timeMilliStart; long timeMilliEnd; boolean error = false; String texterr; long sumSize; @Override protected Boolean doInBackground() throws Exception { try { UtilFileSystemClass ufs = new UtilFileSystemClass(); ArrayList files = ufs.getAllFiles(path); int blocksize = blocksize1; sumSize = 0; long chunk = files.size() / 100; long curChunk = chunk; timeMilliStart = System.currentTimeMillis(); long idx = 0; int publishPer = 0; for (File f : files) { sumSize += f.length(); ufs.readFile(f, method, blocksize); idx++; if (idx > curChunk) { curChunk += chunk; publishPer++; publish(publishPer); } } timeMilliEnd = System.currentTimeMillis(); } catch (Exception ex) { error = true; texterr = ex.toString(); } return true; } // Can safely update the GUI from this method. protected void done() { boolean status; try { if (error) { jTextAreaResults.setText(texterr); } else { jTextAreaResults.setText("Анализ завершен, время проведения " + String.format("%.2f", (timeMilliEnd - timeMilliStart)/((double)1000*60)) + " мин"); double speed = sumSize / (((double) (timeMilliEnd - timeMilliStart)) / 1000); jTextAreaResults.setText(jTextAreaResults.getText() + "\r\n" + "Средняя скорость доступа (МБ/c) " + String.format("%.2f",speed/(1024*1204))); } } // This is thrown if the thread's interrupted. catch (Exception e) { jTextAreaResults.setText(e.toString()); }finally{ jButtonStart.setEnabled(true); } } @Override // Can safely update the GUI from this method. protected void process(List chunks) { // Here we receive the values that we publish(). // They may come grouped in chunks. int mostRecentValue = chunks.get(chunks.size() - 1); jProgressBar1.setValue(mostRecentValue); } }; FileReadMethod method = FileReadMethod.forward; switch (this.jComboBoxAMethod.getSelectedIndex()) { case 0: method = FileReadMethod.forward; break; case 1: method = FileReadMethod.backward; break; case 2: method = FileReadMethod.random; break; } this.jButtonStart.setEnabled(false); this.jTextAreaResults.setText(""); this.jProgressBar1.setValue(0); worker.setParams(method, this.jComboBoxDisks.getSelectedItem().toString()+":\\", Integer.parseInt(this.jTextFieldBlockSize.getText())); worker.execute(); } public static void main(String args[]) { try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(MainForm.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } // /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new MainForm().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButtonStart; private javax.swing.JComboBox jComboBoxAMethod; private javax.swing.JComboBox jComboBoxDisks; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JProgressBar jProgressBar1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea jTextAreaResults; private javax.swing.JTextField jTextFieldBlockSize; // End of variables declaration }Defrag_analysis.javapackage com.mycompany.defrag_analysis;public class Defrag_analysis { public static void main(String[] args) { new MainForm().setVisible(true); }}FileReadMethod.javapackage com.mycompany.defrag_analysis;public enum FileReadMethod { forward, backward, random}

1. Лафоре, Р. Структуры данных и алгоритмы Java / Р. Лафоре. – 2-е изд. – Санкт-Петербург : Питер, 2018. – 704 с.
2. Седжвик, Р. Computer Science : основы программирования на Java, ООП, алгоритмы и структуры данных / Р. Седжвик. – Санкт-Петербург : Питер, 2018. – 1072 с Jason Alls, «Clean Code in C# » - 2020г - 500с
3. Аспекты производительности, связанные с управлением дисковым вводом-выводом. 2021 Режим доступа : https://www.ibm.com/docs/ru/aix/7.2?topic=management-fixed-disk-storage-performance
4. Кей Хорстманн «Java. Библиотека профессионала» «Диалектика-Вильямс», 2020 год, 1-й том — 864 с., 2-й том — 1008 с.
5. Эванс, Флэнаган: Java. Справочник разработчика Вильямс, 2019 г. – с . 592