= YES; /* ------ object archive ---------------- */NSMutableData * data = [NSMutableData data]; NSKeyedArchiver * archiver = [[NSKeyedArchiver alloc] encoding: data]; // encode multiple objects for archiving, key is the identifier of the object when the file is Unarchived. You can write // encode with multiple overloading methods. However, not any system object has an overload method [archiver encodeObject
Percona-toolkit tutorial tools
1. pt-archiver
Function introduction:
Archive the records of tables in the mysql database to another table or file
Usage:
Pt-archiver [OPTION...] -- source DSN -- where WHERE
This tool only archives old data and does not significantly affect OLTP query of online data. You can insert the data into other tables on another server or write it into a file, it is convenient to use t
also note that the archive operation can not cause MySQL and server overload. Our goal is to make the entire archive process stable and reliable, with no negative effects other than reducing query response time. Mk-archiver can help us achieve our wishes.Mk-archiver has two basic job requirements, the first is that the archive object must be able to be identified. For example, if there is a date column in
, the better
Large volumes may waste a lot of space in the InnoDB. For example, if the stored field value is only one byte longer than the row requirement, the entire page is used to store the remaining bytes, wasting most of the page space. If you have a value that only slightly exceeds the size of 32 pages, you actually need to use 96 pages
Extended storage disables adaptive hashing because the entire length of the column needs to be fully compared to find out if it is the correc
Definition of Object archive:An object archive is an object archive that is saved as a file to disk, and used to read the contents of a file in the path saved by the file.Using Nskeyedarichiver for archiving, nskeyedunarchiver, this way, the data is serialized and deserialized before the data is written and read.Single object archiving, multiple object archiving, custom object archivingCommon archives are generally used in tool classes to archive immutable data, and variable data is not archived
Archiving and recovery archivingArchive, English archiver[' ɑrk?v?], this refers to storing OC objects as a file or a block of data on the network.Recovery archive, English unarchiver, refers to restoring an archived block of data from a file or network to an OC object in memory.Archiving and recovery is primarily used to store custom type objects, save custom data before a program is paused or closed, and read stored custom data after the program res
transmission.
// For example, images and large files
// Resumable upload. The size of the fake part is 20 mb,
// Send an email: add an attachment
NSMutableData * data = [NSMutableData alloc] init];
// InitForWritingWithMutableData specifies the data stream file to be written.
NSKeyedArchiver * archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData: data];
// Encode the data. Parameter 1: The data to be encoded; parameter 2: The key and k
After the site is created, you can modify discuz! After the Forum step is completed, it is very interesting to change it to what you like. I will not talk much about it. Next I will introduce you to the modification method.
1. [modify the copyright of the background-Home Page] open ftp, connect to the site, go to/FTP/web/source/admincp // path, find admin_main.php, right-click to view, press Ctrl + F to find "power" and make the following changes:
Save the changes and refresh your website. Then
optimize the various angles, then the final constraint on performance is the bottleneck is the size of the list. Archiving the contents of the various rows in a large list can effectively shorten the response time of the query instruction.Unless the contents of the list are not important, you must not delete the content line. Archiving also requires skill, because the first data can not be missing, the list can not be too locked to avoid the impact of access, but also note that the archive oper
Log file switch and log file sync 10.3.15 log file switchThere are two wait events commonly encountered: log file switch (archiving needed) log file switch (checkpoint incomplete) In both of the events, the LGWR is unable to switch into the next online redo log, and all the commit requests wait for this event.10.3.15.1 ActionsFor the log file switch (archiving needed) event, examine why the archiver is unable to archive the logs in a timely fashion. i
) age {if (self = [super init]) {self. name = name; self. age = age; self. gender = gender;} return self;}-(NSString *) description {return [NSString stringWithFormat: @ % @-% ld, _ name, _ gender, _ age] ;}// the archive protocol method-(void) encodeWithCoder: (NSCoder *) acder {// more than archive this object, its attributes must be archived, in this case, you need to encode the attributes of [ACO der encodeObject: self. name forKey: @ name]; [aCoder encodeObject: self. gender forKey: @ gende
to the encodeWithCoder: method:
[SuperencodeWithCode: encode];
Ensure that the inherited instance variables can also be encoded, that is, they can also be archived.U should add the following sentence to the initWithCoder: method:
Self = [super initWithCoder: decoder];
Make sure that the inherited instance variables can also be decoded and restored.
NSDataL use the archiveRootObject: toFile: Method to directly write an object to a file, but sometimes you may want to write multiple objects to t
" ofType: @ "plist"];
NSMutableDictionary * dic = [[NSMutableDictionary alloc] initWithContentsOfFile: filePath];
2. Save or create a plist file after modifying the data
[Dic writeToFile: filePath atomically: YES];
NSKeydArchiver and NSKeyedUnarchiver:
1. There is a class method for archiving: + (BOOL) archiveRootObject :( id) rootObject toFile :( NSString *) path;
The solution has a class method: + (nullable id) unarchiveObjectWithFile :( NSString *) path;
You can archive and archive an object
Remove the previous one.8. When the Discuz background starts URL static, the system will prompt the solution of 404 Not Found:Enable Rewrite in nginx, write the following content in the server configuration file "nginx. conf", and then restart nginx.
Code:Copy codeThe Code is as follows: rewrite ^/archiver/(fid | tid0000-0000w-00000000.html) $/archiver/index. php? $1 last;Rewrite ^/forum-(%0-9%%%%-(%0-9%%%
Simple objects such as nsstring,nsnumber,nsarray,nsdictionary can be conveniently stored in local sandbox files, and complex objects, such as properties and methods, require the use of archive anti-archiving methods (serialization and deserialization). stored in a nsdata manner.Archive anti-archiving, the main sequence of operations is: encoding (enCoding), archive (archiver), decode (decoding), Reverse archive (unarchiver)1. Encoding and decoding met
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.