| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# Copyright 2016 - present MongoDB, Inc. |
|
2
|
|
|
|
|
|
|
# |
|
3
|
|
|
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); |
|
4
|
|
|
|
|
|
|
# you may not use this file except in compliance with the License. |
|
5
|
|
|
|
|
|
|
# You may obtain a copy of the License at |
|
6
|
|
|
|
|
|
|
# |
|
7
|
|
|
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0 |
|
8
|
|
|
|
|
|
|
# |
|
9
|
|
|
|
|
|
|
# Unless required by applicable law or agreed to in writing, software |
|
10
|
|
|
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, |
|
11
|
|
|
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
12
|
|
|
|
|
|
|
# See the License for the specific language governing permissions and |
|
13
|
|
|
|
|
|
|
# limitations under the License. |
|
14
|
|
|
|
|
|
|
|
|
15
|
59
|
|
|
59
|
|
382
|
use strict; |
|
|
59
|
|
|
|
|
119
|
|
|
|
59
|
|
|
|
|
1689
|
|
|
16
|
59
|
|
|
59
|
|
293
|
use warnings; |
|
|
59
|
|
|
|
|
127
|
|
|
|
59
|
|
|
|
|
2180
|
|
|
17
|
|
|
|
|
|
|
package MongoDB::Op::_RenameCollection; |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# Implements a collection move/rename; returns a MongoDB::CommandResult |
|
20
|
|
|
|
|
|
|
|
|
21
|
59
|
|
|
59
|
|
287
|
use version; |
|
|
59
|
|
|
|
|
120
|
|
|
|
59
|
|
|
|
|
357
|
|
|
22
|
|
|
|
|
|
|
our $VERSION = 'v2.2.2'; |
|
23
|
|
|
|
|
|
|
|
|
24
|
59
|
|
|
59
|
|
4138
|
use Moo; |
|
|
59
|
|
|
|
|
122
|
|
|
|
59
|
|
|
|
|
298
|
|
|
25
|
|
|
|
|
|
|
|
|
26
|
59
|
|
|
59
|
|
16050
|
use MongoDB::Op::_Command; |
|
|
59
|
|
|
|
|
151
|
|
|
|
59
|
|
|
|
|
1380
|
|
|
27
|
59
|
|
|
|
|
537
|
use Types::Standard qw( |
|
28
|
|
|
|
|
|
|
Str |
|
29
|
59
|
|
|
59
|
|
292
|
); |
|
|
59
|
|
|
|
|
118
|
|
|
30
|
|
|
|
|
|
|
|
|
31
|
59
|
|
|
59
|
|
29402
|
use namespace::clean; |
|
|
59
|
|
|
|
|
138
|
|
|
|
59
|
|
|
|
|
372
|
|
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has [ 'src_ns', 'dst_ns' ] => ( |
|
34
|
|
|
|
|
|
|
is => 'ro', |
|
35
|
|
|
|
|
|
|
required => 1, |
|
36
|
|
|
|
|
|
|
isa => Str, |
|
37
|
|
|
|
|
|
|
); |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
with $_ for qw( |
|
40
|
|
|
|
|
|
|
MongoDB::Role::_PrivateConstructor |
|
41
|
|
|
|
|
|
|
MongoDB::Role::_DatabaseOp |
|
42
|
|
|
|
|
|
|
MongoDB::Role::_WriteOp |
|
43
|
|
|
|
|
|
|
); |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
sub execute { |
|
46
|
0
|
|
|
0
|
0
|
|
my ( $self, $link ) = @_; |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
my $op = MongoDB::Op::_Command->_new( |
|
49
|
|
|
|
|
|
|
db_name => 'admin', # special for this command -- not the db_name attribute |
|
50
|
|
|
|
|
|
|
query => [ |
|
51
|
|
|
|
|
|
|
renameCollection => $self->src_ns, |
|
52
|
|
|
|
|
|
|
to => $self->dst_ns, |
|
53
|
0
|
0
|
|
|
|
|
( $link->supports_helper_write_concern ? ( @{ $self->write_concern->as_args } ) : () ), |
|
|
0
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
], |
|
55
|
|
|
|
|
|
|
query_flags => {}, |
|
56
|
|
|
|
|
|
|
bson_codec => $self->bson_codec, |
|
57
|
|
|
|
|
|
|
session => $self->session, |
|
58
|
|
|
|
|
|
|
monitoring_callback => $self->monitoring_callback, |
|
59
|
|
|
|
|
|
|
); |
|
60
|
|
|
|
|
|
|
|
|
61
|
0
|
|
|
|
|
|
my $res = $op->execute($link); |
|
62
|
0
|
|
|
|
|
|
$res->assert_no_write_concern_error; |
|
63
|
|
|
|
|
|
|
|
|
64
|
0
|
|
|
|
|
|
return $res; |
|
65
|
|
|
|
|
|
|
} |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
1; |