-Stream chunk 10MB 1 worker
This commit is contained in:
tonikelope 2018-03-06 15:19:35 +01:00
parent 43b74e9924
commit a049646f93
6 changed files with 11 additions and 11 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.tonikelope</groupId> <groupId>com.tonikelope</groupId>
<artifactId>MegaBasterd</artifactId> <artifactId>MegaBasterd</artifactId>
<version>2.99</version> <version>3.0</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<dependencies> <dependencies>
<dependency> <dependency>

View File

@ -37,7 +37,7 @@ public final class KissVideoStreamServer implements HttpHandler, SecureSingleThr
public static final int THREAD_START = 0x01; public static final int THREAD_START = 0x01;
public static final int THREAD_STOP = 0x02; public static final int THREAD_STOP = 0x02;
public static final int CHUNK_WORKERS = 8; public static final int CHUNK_WORKERS = 1;
private final MainPanel _main_panel; private final MainPanel _main_panel;
private final ConcurrentHashMap<String, HashMap<String, Object>> _link_cache; private final ConcurrentHashMap<String, HashMap<String, Object>> _link_cache;

View File

@ -48,7 +48,7 @@ import org.apache.http.auth.UsernamePasswordCredentials;
*/ */
public final class MainPanel { public final class MainPanel {
public static final String VERSION = "2.99"; public static final String VERSION = "3.0";
public static final int THROTTLE_SLICE_SIZE = 16 * 1024; public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024; public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024;
public static final int STREAMER_PORT = 1337; public static final int STREAMER_PORT = 1337;

View File

@ -325,7 +325,7 @@
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="2"/> <Font name="Dialog" size="14" style="2"/>
</Property> </Property>
<Property name="text" type="java.lang.String" value="Note: if you want to download without using a MEGA PREMIUM account you SHOULD enable MULTI SLOT. "/> <Property name="text" type="java.lang.String" value="Note: if you want to download without using a MEGA PREMIUM account you SHOULD enable MULTI SLOT (try to set as few slots as possible). "/>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JSeparator" name="jSeparator3"> <Component class="javax.swing.JSeparator" name="jSeparator3">
@ -600,7 +600,7 @@
</Group> </Group>
<Component id="limit_upload_speed_checkbox" min="-2" max="-2" attributes="0"/> <Component id="limit_upload_speed_checkbox" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace min="0" pref="551" max="32767" attributes="0"/> <EmptySpace min="0" pref="308" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
@ -727,7 +727,7 @@
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor"> <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="2"/> <Font name="Dialog" size="14" style="2"/>
</Property> </Property>
<Property name="text" type="java.lang.String" value="Note: MULTI-SLOT is required if you want to exit and resume uploads."/> <Property name="text" type="java.lang.String" value="Note: MULTI-SLOT is required if you want to exit and resume uploads (try to set as few slots as possible)."/>
</Properties> </Properties>
</Component> </Component>
</SubComponents> </SubComponents>

View File

@ -616,7 +616,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
megacrypter_reverse_warning_label.setText("Note: you MUST \"OPEN\" this port in your router/firewall."); megacrypter_reverse_warning_label.setText("Note: you MUST \"OPEN\" this port in your router/firewall.");
rec_download_slots_label.setFont(new java.awt.Font("Dialog", 2, 14)); // NOI18N rec_download_slots_label.setFont(new java.awt.Font("Dialog", 2, 14)); // NOI18N
rec_download_slots_label.setText("Note: if you want to download without using a MEGA PREMIUM account you SHOULD enable MULTI SLOT. "); rec_download_slots_label.setText("Note: if you want to download without using a MEGA PREMIUM account you SHOULD enable MULTI SLOT (try to set as few slots as possible). ");
megacrypter_reverse_checkbox.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N megacrypter_reverse_checkbox.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
megacrypter_reverse_checkbox.setText("Use Megacrypter reverse mode"); megacrypter_reverse_checkbox.setText("Use Megacrypter reverse mode");
@ -916,7 +916,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
}); });
rec_upload_slots_label.setFont(new java.awt.Font("Dialog", 2, 14)); // NOI18N rec_upload_slots_label.setFont(new java.awt.Font("Dialog", 2, 14)); // NOI18N
rec_upload_slots_label.setText("Note: MULTI-SLOT is required if you want to exit and resume uploads."); rec_upload_slots_label.setText("Note: MULTI-SLOT is required if you want to exit and resume uploads (try to set as few slots as possible).");
javax.swing.GroupLayout uploads_panelLayout = new javax.swing.GroupLayout(uploads_panel); javax.swing.GroupLayout uploads_panelLayout = new javax.swing.GroupLayout(uploads_panel);
uploads_panel.setLayout(uploads_panelLayout); uploads_panel.setLayout(uploads_panelLayout);
@ -949,7 +949,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(max_up_speed_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(max_up_speed_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(limit_upload_speed_checkbox)) .addComponent(limit_upload_speed_checkbox))
.addGap(0, 551, Short.MAX_VALUE))) .addGap(0, 308, Short.MAX_VALUE)))
.addContainerGap()))) .addContainerGap())))
); );
uploads_panelLayout.setVerticalGroup( uploads_panelLayout.setVerticalGroup(

View File

@ -16,8 +16,8 @@ import static com.tonikelope.megabasterd.MiscTools.*;
*/ */
public class StreamChunkWriter implements Runnable, SecureMultiThreadNotifiable { public class StreamChunkWriter implements Runnable, SecureMultiThreadNotifiable {
public static final int CHUNK_SIZE = 1048576; public static final int CHUNK_SIZE = 10485760; //10 MB
public static final int BUFFER_CHUNKS_SIZE = 20; public static final int BUFFER_CHUNKS_SIZE = 3;
private long _next_offset_required; private long _next_offset_required;
private long _bytes_written; private long _bytes_written;
private final long _start_offset; private final long _start_offset;